summaryrefslogtreecommitdiff
path: root/libpod/runtime_volume.go
diff options
context:
space:
mode:
authorBaron Lenardson <lenardson.baron@gmail.com>2020-12-10 20:30:28 -0600
committerBaron Lenardson <lenardson.baron@gmail.com>2020-12-12 20:07:04 -0600
commita0204ada0974343cbf6eefe988ef35cdfe28fb52 (patch)
tree6271ae99e76ca81f38e3ea80136d7195a843b19c /libpod/runtime_volume.go
parent9216be2008696bc9f0bc26686be8becae3d12bfc (diff)
downloadpodman-a0204ada0974343cbf6eefe988ef35cdfe28fb52.tar.gz
podman-a0204ada0974343cbf6eefe988ef35cdfe28fb52.tar.bz2
podman-a0204ada0974343cbf6eefe988ef35cdfe28fb52.zip
Add volume prune --filter support
This change adds support for the `--filter` / `?filters` arguments on the `podman volume prune` subcommand. * Adds ParseFilterArgumentsIntoFilters helper for consistent Filter string slice handling * Adds `--filter` support to podman volume prune cli * Adds `?filters...` support to podman volume prune api * Updates apiv2 / e2e tests Closes #8672 Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
Diffstat (limited to 'libpod/runtime_volume.go')
-rw-r--r--libpod/runtime_volume.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpod/runtime_volume.go b/libpod/runtime_volume.go
index 055a243c0..10c32a119 100644
--- a/libpod/runtime_volume.go
+++ b/libpod/runtime_volume.go
@@ -133,9 +133,9 @@ func (r *Runtime) GetAllVolumes() ([]*Volume, error) {
}
// PruneVolumes removes unused volumes from the system
-func (r *Runtime) PruneVolumes(ctx context.Context) (map[string]error, error) {
+func (r *Runtime) PruneVolumes(ctx context.Context, filterFuncs []VolumeFilter) (map[string]error, error) {
reports := make(map[string]error)
- vols, err := r.GetAllVolumes()
+ vols, err := r.Volumes(filterFuncs...)
if err != nil {
return nil, err
}