summaryrefslogtreecommitdiff
path: root/pkg/specgenutil/specgen.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/specgenutil/specgen.go')
-rw-r--r--pkg/specgenutil/specgen.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go
index 8e43cc50e..70b6abff5 100644
--- a/pkg/specgenutil/specgen.go
+++ b/pkg/specgenutil/specgen.go
@@ -205,9 +205,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
}