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/volume_internal.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/volume_internal.go')
-rw-r--r-- | libpod/volume_internal.go | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/libpod/volume_internal.go b/libpod/volume_internal.go index 694cdd149..19008a253 100644 --- a/libpod/volume_internal.go +++ b/libpod/volume_internal.go @@ -39,8 +39,23 @@ func (v *Volume) needsMount() bool { return true } - // Local driver with options needs mount - return len(v.config.Options) > 0 + // Commit 28138dafcc added the UID and GID options to this map + // However we should only mount when options other than uid and gid are set. + // see https://github.com/containers/podman/issues/10620 + index := 0 + if _, ok := v.config.Options["UID"]; ok { + index++ + } + if _, ok := v.config.Options["GID"]; ok { + index++ + } + // when uid or gid is set there is also the "o" option + // set so we have to ignore this one as well + if index > 0 { + index++ + } + // Local driver with options other than uid,gid needs mount + return len(v.config.Options) > index } // update() updates the volume state from the DB. |