diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-04-21 16:10:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-21 16:10:28 -0400 |
commit | 02bd8cef7b7286f8955a68a00294c08d81803a4a (patch) | |
tree | 034552b9f00d16c3d69cc4dff7621f3764c42733 /pkg/domain/infra/runtime_libpod.go | |
parent | 103eca67b720931869e1932002a384ac8ad889ff (diff) | |
parent | 6e3ad47b581e065eec6947df65cf8d1d042b7a95 (diff) | |
download | podman-02bd8cef7b7286f8955a68a00294c08d81803a4a.tar.gz podman-02bd8cef7b7286f8955a68a00294c08d81803a4a.tar.bz2 podman-02bd8cef7b7286f8955a68a00294c08d81803a4a.zip |
Merge pull request #5916 from giuseppe/userns-auto
v2, podman: plug --userns=auto
Diffstat (limited to 'pkg/domain/infra/runtime_libpod.go')
-rw-r--r-- | pkg/domain/infra/runtime_libpod.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/domain/infra/runtime_libpod.go b/pkg/domain/infra/runtime_libpod.go index dc59fec3d..a6974d251 100644 --- a/pkg/domain/infra/runtime_libpod.go +++ b/pkg/domain/infra/runtime_libpod.go @@ -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") |