summaryrefslogtreecommitdiff
path: root/libpod/volume.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-23 14:41:55 +0200
committerGitHub <noreply@github.com>2022-09-23 14:41:55 +0200
commita80c406f833190070636c5982f5b0aff58f9b23d (patch)
treeb694fa3e2fe8e5d134b83ca64b4f6867987e2456 /libpod/volume.go
parent0d65c2481973a956bb90e393814a18ceb6389450 (diff)
parentfc6dcd12b3430f2d1ee495ef19d184a088f3bb34 (diff)
downloadpodman-a80c406f833190070636c5982f5b0aff58f9b23d.tar.gz
podman-a80c406f833190070636c5982f5b0aff58f9b23d.tar.bz2
podman-a80c406f833190070636c5982f5b0aff58f9b23d.zip
Merge pull request #15841 from mheon/image_driver
Add support for 'image' volume driver
Diffstat (limited to 'libpod/volume.go')
-rw-r--r--libpod/volume.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/libpod/volume.go b/libpod/volume.go
index a054e4032..2d4ea4280 100644
--- a/libpod/volume.go
+++ b/libpod/volume.go
@@ -57,6 +57,15 @@ type VolumeConfig struct {
DisableQuota bool `json:"disableQuota,omitempty"`
// Timeout allows users to override the default driver timeout of 5 seconds
Timeout *uint `json:"timeout,omitempty"`
+ // StorageName is the name of the volume in c/storage. Only used for
+ // image volumes.
+ StorageName string `json:"storageName,omitempty"`
+ // StorageID is the ID of the volume in c/storage. Only used for image
+ // volumes.
+ StorageID string `json:"storageID,omitempty"`
+ // StorageImageID is the ID of the image the volume was based off of.
+ // Only used for image volumes.
+ StorageImageID string `json:"storageImageID,omitempty"`
}
// VolumeState holds the volume's mutable state.
@@ -149,7 +158,7 @@ func (v *Volume) MountCount() (uint, error) {
// Internal-only helper for volume mountpoint
func (v *Volume) mountPoint() string {
- if v.UsesVolumeDriver() {
+ if v.UsesVolumeDriver() || v.config.Driver == define.VolumeDriverImage {
return v.state.MountPoint
}
@@ -250,6 +259,12 @@ func (v *Volume) IsDangling() (bool, error) {
// drivers are pluggable backends for volumes that will manage the storage and
// mounting.
func (v *Volume) UsesVolumeDriver() bool {
+ if v.config.Driver == define.VolumeDriverImage {
+ if _, ok := v.runtime.config.Engine.VolumePlugins[v.config.Driver]; ok {
+ return true
+ }
+ return false
+ }
return !(v.config.Driver == define.VolumeDriverLocal || v.config.Driver == "")
}