summaryrefslogtreecommitdiff
path: root/libpod/volume_internal.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-12-06 08:59:13 -0800
committerGitHub <noreply@github.com>2018-12-06 08:59:13 -0800
commit5c6e02b55be974f08e3b1e895046a3cf167fd3f7 (patch)
tree7d0e2a5a0ec706e5f4dc6b12ddbb8a1002232b24 /libpod/volume_internal.go
parent3e60de629d5feaff1ac15173b4ff1e5325dfa5dc (diff)
parent375831e97693af4d894cf647af4dad57ef21948d (diff)
downloadpodman-5c6e02b55be974f08e3b1e895046a3cf167fd3f7.tar.gz
podman-5c6e02b55be974f08e3b1e895046a3cf167fd3f7.tar.bz2
podman-5c6e02b55be974f08e3b1e895046a3cf167fd3f7.zip
Merge pull request #1904 from umohnani8/volume
Add "podman volume" command
Diffstat (limited to 'libpod/volume_internal.go')
-rw-r--r--libpod/volume_internal.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/libpod/volume_internal.go b/libpod/volume_internal.go
new file mode 100644
index 000000000..800e6d106
--- /dev/null
+++ b/libpod/volume_internal.go
@@ -0,0 +1,29 @@
+package libpod
+
+import (
+ "os"
+ "path/filepath"
+)
+
+// VolumePath is the path under which all volumes that are created using the
+// local driver will be created
+// const VolumePath = "/var/lib/containers/storage/volumes"
+
+// Creates a new volume
+func newVolume(runtime *Runtime) (*Volume, error) {
+ volume := new(Volume)
+ volume.config = new(VolumeConfig)
+ volume.runtime = runtime
+ volume.config.Labels = make(map[string]string)
+ volume.config.Options = make(map[string]string)
+
+ return volume, nil
+}
+
+// teardownStorage deletes the volume from volumePath
+func (v *Volume) teardownStorage() error {
+ if !v.valid {
+ return ErrNoSuchVolume
+ }
+ return os.RemoveAll(filepath.Join(v.runtime.config.VolumePath, v.Name()))
+}