summaryrefslogtreecommitdiff
path: root/libpod/volume_internal_linux.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-24 17:21:24 -0700
committerGitHub <noreply@github.com>2021-03-24 17:21:24 -0700
commite523d09638b05edfd51538ac5786f00793e396ee (patch)
tree2c84c89159b21ebe5455d4030be9ceca25558add /libpod/volume_internal_linux.go
parentebb57df0f67c1e92ad246bab74f971390c793b98 (diff)
parentf2181141e1aea2bafef786d83b90eea54010854b (diff)
downloadpodman-e523d09638b05edfd51538ac5786f00793e396ee.tar.gz
podman-e523d09638b05edfd51538ac5786f00793e396ee.tar.bz2
podman-e523d09638b05edfd51538ac5786f00793e396ee.zip
Merge pull request #9808 from thephoenixofthevoid/issue-9650-fixed
[NO TESTS NEEDED] Fix rootless volume plugins
Diffstat (limited to 'libpod/volume_internal_linux.go')
-rw-r--r--libpod/volume_internal_linux.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/libpod/volume_internal_linux.go b/libpod/volume_internal_linux.go
index 67ac41874..92391de1d 100644
--- a/libpod/volume_internal_linux.go
+++ b/libpod/volume_internal_linux.go
@@ -32,8 +32,10 @@ func (v *Volume) mount() error {
return nil
}
- // We cannot mount volumes as rootless.
- if rootless.IsRootless() {
+ // We cannot mount 'local' volumes as rootless.
+ if !v.UsesVolumeDriver() && rootless.IsRootless() {
+ // This check should only be applied to 'local' driver
+ // so Volume Drivers must be excluded
return errors.Wrapf(define.ErrRootless, "cannot mount volumes without root privileges")
}
@@ -137,8 +139,8 @@ func (v *Volume) unmount(force bool) error {
return nil
}
- // We cannot unmount volumes as rootless.
- if rootless.IsRootless() {
+ // We cannot unmount 'local' volumes as rootless.
+ if !v.UsesVolumeDriver() && rootless.IsRootless() {
// If force is set, just clear the counter and bail without
// error, so we can remove volumes from the state if they are in
// an awkward configuration.