diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-06-24 14:44:28 +0200 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-07-06 13:31:21 -0400 |
commit | eb85f429073d7dca0d2d01a1afe5a972ca9b429b (patch) | |
tree | 3d13a945d2dced49b1c06147873d3e23a8ab0432 /libpod/runtime_ctr.go | |
parent | f5b368400c1b7a1b1bdbb90f6a0d9fcbbd6802d0 (diff) | |
download | podman-eb85f429073d7dca0d2d01a1afe5a972ca9b429b.tar.gz podman-eb85f429073d7dca0d2d01a1afe5a972ca9b429b.tar.bz2 podman-eb85f429073d7dca0d2d01a1afe5a972ca9b429b.zip |
container: move volume chown after spec generation
move the chown for newly created volumes after the spec generation so
the correct UID/GID are known.
Closes: https://github.com/containers/libpod/issues/5698
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index 4010c9bea..c073aabb5 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -309,7 +309,7 @@ func (r *Runtime) setupContainer(ctx context.Context, ctr *Container) (_ *Contai logrus.Debugf("Creating new volume %s for container", vol.Name) // The volume does not exist, so we need to create it. - volOptions := []VolumeCreateOption{WithVolumeName(vol.Name), WithVolumeUID(ctr.RootUID()), WithVolumeGID(ctr.RootGID())} + volOptions := []VolumeCreateOption{WithVolumeName(vol.Name), WithVolumeUID(ctr.RootUID()), WithVolumeGID(ctr.RootGID()), WithVolumeNeedsChown()} if isAnonymous { volOptions = append(volOptions, withSetAnon()) } |