summaryrefslogtreecommitdiff
path: root/libpod/options.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/options.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/options.go')
-rw-r--r--libpod/options.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 184d5d59f..1e8592a25 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -1248,6 +1248,22 @@ func WithVolumeOptions(options map[string]string) VolumeCreateOption {
}
}
+// withSetCtrSpecific sets a bool notifying libpod that a volume was created
+// specifically for a container.
+// These volumes will be removed when the container is removed and volumes are
+// also specified for removal.
+func withSetCtrSpecific() VolumeCreateOption {
+ return func(volume *Volume) error {
+ if volume.valid {
+ return ErrVolumeFinalized
+ }
+
+ volume.config.IsCtrSpecific = true
+
+ return nil
+ }
+}
+
// Pod Creation Options
// WithPodName sets the name of the pod.