summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index e22c81f91..1e8592a25 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -47,6 +47,11 @@ func WithStorageConfig(config storage.StoreOptions) RuntimeOption {
rt.config.StaticDir = filepath.Join(config.GraphRoot, "libpod")
rt.configuredFrom.libpodStaticDirSet = true
+ // Also set libpod volume path, so we are a subdirectory
+ // of the c/storage store by default
+ rt.config.VolumePath = filepath.Join(config.GraphRoot, "volumes")
+ rt.configuredFrom.volPathSet = true
+
setField = true
}
@@ -359,6 +364,7 @@ func WithVolumePath(volPath string) RuntimeOption {
}
rt.config.VolumePath = volPath
+ rt.configuredFrom.volPathSet = true
return nil
}
@@ -1242,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.