summaryrefslogtreecommitdiff
path: root/libpod/state.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-08-27 15:25:54 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-09-09 12:06:10 -0400
commit046178e55f72ed9db7cf5898d3be91b0112ab94f (patch)
treead844579a48f043d1959233ca881307801f79a45 /libpod/state.go
parent16a70490852fdaf3ea5aeea6b2be19dd70fbf1c7 (diff)
downloadpodman-046178e55f72ed9db7cf5898d3be91b0112ab94f.tar.gz
podman-046178e55f72ed9db7cf5898d3be91b0112ab94f.tar.bz2
podman-046178e55f72ed9db7cf5898d3be91b0112ab94f.zip
Add function for looking up volumes by partial name
This isn't included in Docker, but seems handy enough. Use the new API for 'volume rm' and 'volume inspect'. Fixes #3891 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/state.go')
-rw-r--r--libpod/state.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/libpod/state.go b/libpod/state.go
index db4667ad6..40080d2cc 100644
--- a/libpod/state.go
+++ b/libpod/state.go
@@ -190,6 +190,9 @@ type State interface {
// Volume accepts full name of volume
// If the volume doesn't exist, an error will be returned
Volume(volName string) (*Volume, error)
+ // LookupVolume accepts an unambiguous partial name or full name of a
+ // volume. Ambiguous names will result in an error.
+ LookupVolume(name string) (*Volume, error)
// HasVolume returns true if volName exists in the state,
// otherwise it returns false
HasVolume(volName string) (bool, error)