diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-06-11 16:31:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-11 16:31:45 -0400 |
commit | af9d690690ae03bb40d8f8da88e3eed57427c80c (patch) | |
tree | f2b56d684bf8904efdbeaf113db2c12877e36f5b /libpod/options.go | |
parent | a634b2cd5977c60f1907733efe07b61ba36271fb (diff) | |
parent | ad3b56c62f07bbbd97433e972db0a0582dd84840 (diff) | |
download | podman-af9d690690ae03bb40d8f8da88e3eed57427c80c.tar.gz podman-af9d690690ae03bb40d8f8da88e3eed57427c80c.tar.bz2 podman-af9d690690ae03bb40d8f8da88e3eed57427c80c.zip |
Merge pull request #10638 from Luap99/volume
Fix volumes with uid and gid options
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go index f942d264b..d3be46ad8 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -1641,6 +1641,19 @@ func WithVolumeGID(gid int) VolumeCreateOption { } } +// WithVolumeNoChown prevents the volume from being chowned to the process uid at first use. +func WithVolumeNoChown() VolumeCreateOption { + return func(volume *Volume) error { + if volume.valid { + return define.ErrVolumeFinalized + } + + volume.state.NeedsChown = false + + 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. |