summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-30 12:01:40 -0400
committerGitHub <noreply@github.com>2020-06-30 12:01:40 -0400
commitc2a0ccd39464a91b7ba5fdca3af3c2ed66f2cbca (patch)
treedd7389bb37563a5636f34b3cf41f1cb2e37f2122 /libpod/options.go
parent83bde3bdaf7f7b24f9ad794154207a95e7747f28 (diff)
parentce74c20ebc07ea541b7cdccd272e34c0336ffbc3 (diff)
downloadpodman-c2a0ccd39464a91b7ba5fdca3af3c2ed66f2cbca.tar.gz
podman-c2a0ccd39464a91b7ba5fdca3af3c2ed66f2cbca.tar.bz2
podman-c2a0ccd39464a91b7ba5fdca3af3c2ed66f2cbca.zip
Merge pull request #6747 from giuseppe/fix-user-volumes
container: move volume chown after spec generation
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 28be1bc03..4041fb1cf 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -1497,6 +1497,19 @@ func WithVolumeGID(gid int) VolumeCreateOption {
}
}
+// WithVolumeNeedsChown sets the NeedsChown flag for the volume.
+func WithVolumeNeedsChown() VolumeCreateOption {
+ return func(volume *Volume) error {
+ if volume.valid {
+ return define.ErrVolumeFinalized
+ }
+
+ volume.state.NeedsChown = true
+
+ return nil
+ }
+}
+
// withSetAnon sets a bool notifying libpod that this volume is anonymous and
// should be removed when containers using it are removed and volumes are
// specified for removal.