diff options
author | Phoenix The Fallen <thephoenixofthevoid@gmail.com> | 2021-03-24 22:53:53 +0300 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2021-03-29 13:21:52 -0400 |
commit | 23f3805df253a6144a7d6891628b6da533a8ecc0 (patch) | |
tree | 4bf941ac01de1332578441b21879071df6976bd6 /libpod/volume_internal_linux.go | |
parent | 5e3445e6e094b2e993962cd37ff0b5b50564bf61 (diff) | |
download | podman-23f3805df253a6144a7d6891628b6da533a8ecc0.tar.gz podman-23f3805df253a6144a7d6891628b6da533a8ecc0.tar.bz2 podman-23f3805df253a6144a7d6891628b6da533a8ecc0.zip |
[NO TESTS NEEDED] Fix rootless volume plugins
In a case of volume plugins with custom options.
Signed-off-by: Phoenix The Fallen <thephoenixofthevoid@gmail.com>
Diffstat (limited to 'libpod/volume_internal_linux.go')
-rw-r--r-- | libpod/volume_internal_linux.go | 10 |
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. |