summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/runtime_libpod.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-04-21 13:46:54 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-04-21 13:46:57 +0200
commit6e3ad47b581e065eec6947df65cf8d1d042b7a95 (patch)
tree45983c16679f59eb2a9efd49145dedd48a7344b9 /pkg/domain/infra/runtime_libpod.go
parent89276a5f92717c4c6a299ca2be182a3797d9c90d (diff)
downloadpodman-6e3ad47b581e065eec6947df65cf8d1d042b7a95.tar.gz
podman-6e3ad47b581e065eec6947df65cf8d1d042b7a95.tar.bz2
podman-6e3ad47b581e065eec6947df65cf8d1d042b7a95.zip
v2, podman: plug --userns=auto
--userns=auto tests pass now. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/domain/infra/runtime_libpod.go')
-rw-r--r--pkg/domain/infra/runtime_libpod.go12
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")