diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2021-08-10 12:55:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-10 12:55:52 +0000 |
commit | e136ad485c626e09e361c37bbd529bb599448ac0 (patch) | |
tree | e3b1c0a96222831481de1358e13dbb086185a9d3 /libpod/container_internal.go | |
parent | 6f61e229911e399d92f8fbe0574654f308f73b39 (diff) | |
parent | 221b1add74e17ded10e8f2f832a53065578aa264 (diff) | |
download | podman-e136ad485c626e09e361c37bbd529bb599448ac0.tar.gz podman-e136ad485c626e09e361c37bbd529bb599448ac0.tar.bz2 podman-e136ad485c626e09e361c37bbd529bb599448ac0.zip |
Merge pull request #10589 from umohnani8/pod-userns
Add support for pod inside of user namespace.
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r-- | libpod/container_internal.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 8ffcccf4c..3f7a4807d 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -367,6 +367,12 @@ func (c *Container) setupStorageMapping(dest, from *storage.IDMappingOptions) { return } *dest = *from + // If we are creating a container inside a pod, we always want to inherit the + // userns settings from the infra container. So clear the auto userns settings + // so that we don't request storage for a new uid/gid map. + if c.PodID() != "" && !c.IsInfra() { + dest.AutoUserNs = false + } if dest.AutoUserNs { overrides := c.getUserOverrides() dest.AutoUserNsOpts.PasswdFile = overrides.ContainerEtcPasswdPath |