diff options
author | Charlie Doern <cdoern@redhat.com> | 2022-07-11 13:51:45 -0400 |
---|---|---|
committer | Charlie Doern <cdoern@redhat.com> | 2022-07-25 09:28:26 -0400 |
commit | 4724a0000d48d372c84057a065e40a1bd298603a (patch) | |
tree | 5324e65ee23a9259c8d55d1c366904729856bc18 /pkg/domain/filters/volumes.go | |
parent | da1f47921685f40f1b26405278cbf9cb2d06fe09 (diff) | |
download | podman-4724a0000d48d372c84057a065e40a1bd298603a.tar.gz podman-4724a0000d48d372c84057a065e40a1bd298603a.tar.bz2 podman-4724a0000d48d372c84057a065e40a1bd298603a.zip |
prune filter handling
network and container prune could not handle the label!=... filter. vendor in c/common to fix this and
add some podman level handling to make everything run smoothly
resolves #14182
Signed-off-by: Charlie Doern <cdoern@redhat.com>
Diffstat (limited to 'pkg/domain/filters/volumes.go')
-rw-r--r-- | pkg/domain/filters/volumes.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/domain/filters/volumes.go b/pkg/domain/filters/volumes.go index 7c5047225..9cec39fbb 100644 --- a/pkg/domain/filters/volumes.go +++ b/pkg/domain/filters/volumes.go @@ -6,6 +6,7 @@ import ( "regexp" "strings" + pruneFilters "github.com/containers/common/pkg/filters" "github.com/containers/podman/v4/libpod" "github.com/containers/podman/v4/pkg/util" ) @@ -36,7 +37,7 @@ func GenerateVolumeFilters(filters url.Values) ([]libpod.VolumeFilter, error) { case "label": filter := val vf = append(vf, func(v *libpod.Volume) bool { - return util.MatchLabelFilters([]string{filter}, v.Labels()) + return pruneFilters.MatchLabelFilters([]string{filter}, v.Labels()) }) case "opt": filterArray := strings.SplitN(val, "=", 2) @@ -100,7 +101,7 @@ func GeneratePruneVolumeFilters(filters url.Values) ([]libpod.VolumeFilter, erro switch filter { case "label": vf = append(vf, func(v *libpod.Volume) bool { - return util.MatchLabelFilters([]string{filterVal}, v.Labels()) + return pruneFilters.MatchLabelFilters([]string{filterVal}, v.Labels()) }) case "until": f, err := createUntilFilterVolumeFunction(filterVal) |