summaryrefslogtreecommitdiff
path: root/libpod/runtime_ctr.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-06-24 14:44:28 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-06-29 17:58:50 +0200
commitb32172e20bbb701e924684ee7ef443748a4f112b (patch)
tree01a05f446b5bde43bd174591e909d136576bed50 /libpod/runtime_ctr.go
parent688cc0aee3f031661b930811b2d95df1d6c601ac (diff)
downloadpodman-b32172e20bbb701e924684ee7ef443748a4f112b.tar.gz
podman-b32172e20bbb701e924684ee7ef443748a4f112b.tar.bz2
podman-b32172e20bbb701e924684ee7ef443748a4f112b.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.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index f1752cbeb..8bb6a4bcf 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())
}