From 6e3ad47b581e065eec6947df65cf8d1d042b7a95 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 21 Apr 2020 13:46:54 +0200 Subject: v2, podman: plug --userns=auto --userns=auto tests pass now. Signed-off-by: Giuseppe Scrivano --- pkg/domain/infra/runtime_libpod.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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") -- cgit v1.2.3-54-g00ecf