Skip to content

Commit

Permalink
Merge pull request #5916 from giuseppe/userns-auto
Browse files Browse the repository at this point in the history
v2, podman: plug --userns=auto
  • Loading branch information
openshift-merge-robot authored Apr 21, 2020
2 parents 103eca6 + 6e3ad47 commit 02bd8ce
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/domain/infra/runtime_libpod.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,18 @@ func ParseIDMapping(mode namespaces.UsernsMode, uidMapSlice, gidMapSlice []strin
HostGIDMapping: true,
}

if mode.IsAuto() {
var err error
options.HostUIDMapping = false
options.HostGIDMapping = false
options.AutoUserNs = true
opts, err := mode.GetAutoOptions()
if err != nil {
return nil, err
}
options.AutoUserNsOpts = *opts
return &options, nil
}
if mode.IsKeepID() {
if len(uidMapSlice) > 0 || len(gidMapSlice) > 0 {
return nil, errors.New("cannot specify custom mappings with --userns=keep-id")
Expand Down

0 comments on commit 02bd8ce

Please sign in to comment.