diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-12-06 08:59:13 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-06 08:59:13 -0800 |
commit | 5c6e02b55be974f08e3b1e895046a3cf167fd3f7 (patch) | |
tree | 7d0e2a5a0ec706e5f4dc6b12ddbb8a1002232b24 /libpod/state.go | |
parent | 3e60de629d5feaff1ac15173b4ff1e5325dfa5dc (diff) | |
parent | 375831e97693af4d894cf647af4dad57ef21948d (diff) | |
download | podman-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/state.go')
-rw-r--r-- | libpod/state.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libpod/state.go b/libpod/state.go index 06c2003d8..88d89f673 100644 --- a/libpod/state.go +++ b/libpod/state.go @@ -153,4 +153,27 @@ type State interface { // If a namespace has been set, only pods in that namespace will be // returned. AllPods() ([]*Pod, error) + + // Volume accepts full name of volume + // If the volume doesn't exist, an error will be returned + Volume(volName string) (*Volume, error) + // HasVolume returns true if volName exists in the state, + // otherwise it returns false + HasVolume(volName string) (bool, error) + // VolumeInUse goes through the container dependencies of a volume + // and checks if the volume is being used by any container. If it is + // a slice of container IDs using the volume is returned + VolumeInUse(volume *Volume) ([]string, error) + // AddVolume adds the specified volume to state. The volume's name + // must be unique within the list of existing volumes + AddVolume(volume *Volume) error + // RemoveVolCtrDep updates the list of container dependencies that the + // volume has. It either deletes the dependent container ID from + // the sub-bucket + RemoveVolCtrDep(volume *Volume, ctrID string) error + // RemoveVolume removes the specified volume. + // Only volumes that have no container dependencies can be removed + RemoveVolume(volume *Volume) error + // AllVolumes returns all the volumes available in the state + AllVolumes() ([]*Volume, error) } |