summaryrefslogtreecommitdiff
path: root/libpod/volume.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-02-26 19:20:08 +0100
committerGitHub <noreply@github.com>2019-02-26 19:20:08 +0100
commit6352f19d884ed5e3826cef453aef5506f14b69c1 (patch)
treeb7a0d51d0811d3115a75b0323b38f3ac99c3b8b2 /libpod/volume.go
parent1ad0d29fc2eb52fec707a4458fe31adc862e2862 (diff)
parent83db80ce172975ddb7c5bfc0d1cea03d5c6b6c94 (diff)
downloadpodman-6352f19d884ed5e3826cef453aef5506f14b69c1.tar.gz
podman-6352f19d884ed5e3826cef453aef5506f14b69c1.tar.bz2
podman-6352f19d884ed5e3826cef453aef5506f14b69c1.zip
Merge pull request #2446 from mheon/add_image_volume
Only remove image volumes when removing containers
Diffstat (limited to 'libpod/volume.go')
-rw-r--r--libpod/volume.go18
1 files changed, 13 insertions, 5 deletions
diff --git a/libpod/volume.go b/libpod/volume.go
index 74878b6a4..0c7618841 100644
--- a/libpod/volume.go
+++ b/libpod/volume.go
@@ -15,11 +15,12 @@ type VolumeConfig struct {
// Name of the volume
Name string `json:"name"`
- Labels map[string]string `json:"labels"`
- MountPoint string `json:"mountPoint"`
- Driver string `json:"driver"`
- Options map[string]string `json:"options"`
- Scope string `json:"scope"`
+ Labels map[string]string `json:"labels"`
+ MountPoint string `json:"mountPoint"`
+ Driver string `json:"driver"`
+ Options map[string]string `json:"options"`
+ Scope string `json:"scope"`
+ IsCtrSpecific bool `json:"ctrSpecific"`
}
// Name retrieves the volume's name
@@ -60,3 +61,10 @@ func (v *Volume) Options() map[string]string {
func (v *Volume) Scope() string {
return v.config.Scope
}
+
+// IsCtrSpecific returns whether this volume was created specifically for a
+// given container. Images with this set to true will be removed when the
+// container is removed with the Volumes parameter set to true.
+func (v *Volume) IsCtrSpecific() bool {
+ return v.config.IsCtrSpecific
+}