diff options
author | umohnani8 <umohnani@redhat.com> | 2018-08-08 09:50:15 -0400 |
---|---|---|
committer | Urvashi Mohnani <umohnani@redhat.com> | 2018-12-06 10:17:16 +0000 |
commit | 4c70b8a94b22b31e2c39ee710dcc21cc2f3fb337 (patch) | |
tree | d6d054bd40f9f0b02c4078b38d2839dc2dd77fc5 /libpod/state.go | |
parent | 75b19ca8abe1957f3c48035767960a6b20c10519 (diff) | |
download | podman-4c70b8a94b22b31e2c39ee710dcc21cc2f3fb337.tar.gz podman-4c70b8a94b22b31e2c39ee710dcc21cc2f3fb337.tar.bz2 podman-4c70b8a94b22b31e2c39ee710dcc21cc2f3fb337.zip |
Add "podman volume" command
Add support for podman volume and its subcommands.
The commands supported are:
podman volume create
podman volume inspect
podman volume ls
podman volume rm
podman volume prune
This is a tool to manage volumes used by podman. For now it only handle
named volumes, but eventually it will handle all volumes used by podman.
Signed-off-by: umohnani8 <umohnani@redhat.com>
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) } |