diff options
Diffstat (limited to 'pkg/specgenutil/specgen.go')
-rw-r--r-- | pkg/specgenutil/specgen.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go index 59ac19c2c..ee089695e 100644 --- a/pkg/specgenutil/specgen.go +++ b/pkg/specgenutil/specgen.go @@ -206,9 +206,13 @@ func setNamespaces(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions) return err } } - // userns must be treated differently + userns := os.Getenv("PODMAN_USERNS") if c.UserNS != "" { - s.UserNS, err = specgen.ParseUserNamespace(c.UserNS) + userns = c.UserNS + } + // userns must be treated differently + if userns != "" { + s.UserNS, err = specgen.ParseUserNamespace(userns) if err != nil { return err } |