diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-01-14 14:33:01 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2022-01-17 06:48:54 -0500 |
commit | 10d969ff1a15e8f53eb5a2fa7eb8cfb321609b55 (patch) | |
tree | fe5be3f9cd57047c393193d467457fcebd1a506a /pkg/specgenutil | |
parent | ea2656dc8658f99a0e9be2342557763e974513b9 (diff) | |
download | podman-10d969ff1a15e8f53eb5a2fa7eb8cfb321609b55.tar.gz podman-10d969ff1a15e8f53eb5a2fa7eb8cfb321609b55.tar.bz2 podman-10d969ff1a15e8f53eb5a2fa7eb8cfb321609b55.zip |
Use PODMAN_USERNS environment variable when running as a service
Fixes: https://github.com/containers/podman/issues/11350#issuecomment-1011562526
Also add inspect information about the idmappings if they exists.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/specgenutil')
-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 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 } |