summaryrefslogtreecommitdiff
path: root/libpod/volume_internal.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-14 21:56:37 -0500
committerGitHub <noreply@github.com>2021-01-14 21:56:37 -0500
commit8ce9995951b14a0a4d7252cdd97597411fd5f980 (patch)
treeb59fcfdfc29ff3979186116e23373c8d72f31169 /libpod/volume_internal.go
parent2b7793b6121d336a285fb7b9a7612c221cbf63d2 (diff)
parentf781efd2dca4c1db54762c6edec2b915e48dd5d8 (diff)
downloadpodman-8ce9995951b14a0a4d7252cdd97597411fd5f980.tar.gz
podman-8ce9995951b14a0a4d7252cdd97597411fd5f980.tar.bz2
podman-8ce9995951b14a0a4d7252cdd97597411fd5f980.zip
Merge pull request #8604 from mheon/volume_plugin_impl
Initial implementation of volume plugins
Diffstat (limited to 'libpod/volume_internal.go')
-rw-r--r--libpod/volume_internal.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/libpod/volume_internal.go b/libpod/volume_internal.go
index 95cb752e0..88d940370 100644
--- a/libpod/volume_internal.go
+++ b/libpod/volume_internal.go
@@ -22,13 +22,24 @@ func newVolume(runtime *Runtime) *Volume {
// teardownStorage deletes the volume from volumePath
func (v *Volume) teardownStorage() error {
+ if v.UsesVolumeDriver() {
+ return nil
+ }
+
+ // TODO: Should this be converted to use v.config.MountPoint?
return os.RemoveAll(filepath.Join(v.runtime.config.Engine.VolumePath, v.Name()))
}
// Volumes with options set, or a filesystem type, or a device to mount need to
// be mounted and unmounted.
func (v *Volume) needsMount() bool {
- return len(v.config.Options) > 0 && v.config.Driver == define.VolumeDriverLocal
+ // Non-local driver always needs mount
+ if v.UsesVolumeDriver() {
+ return true
+ }
+
+ // Local driver with options needs mount
+ return len(v.config.Options) > 0
}
// update() updates the volume state from the DB.