summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-12-22 11:02:19 -0500
committerGitHub <noreply@github.com>2020-12-22 11:02:19 -0500
commit07663f74c48d11732a3330248f837d5abf86fe9c (patch)
tree2446603ff11ddb7517fefee7c11fb5cf287fbbb7 /libpod
parentcfdb8fb29b34010206ea26f38e130d3e24403abf (diff)
parent5923656f321a9ca7b222c81cdb5f3387cc7cd3ad (diff)
downloadpodman-07663f74c48d11732a3330248f837d5abf86fe9c.tar.gz
podman-07663f74c48d11732a3330248f837d5abf86fe9c.tar.bz2
podman-07663f74c48d11732a3330248f837d5abf86fe9c.zip
Merge pull request #8724 from bblenard/support-volume-filters-in-system-prune
Add volume filters to system prune
Diffstat (limited to 'libpod')
-rw-r--r--libpod/filters/helpers.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/libpod/filters/helpers.go b/libpod/filters/helpers.go
new file mode 100644
index 000000000..859db3a9a
--- /dev/null
+++ b/libpod/filters/helpers.go
@@ -0,0 +1,20 @@
+package lpfilters
+
+import (
+ "net/url"
+ "strings"
+
+ "github.com/pkg/errors"
+)
+
+func ParseFilterArgumentsIntoFilters(filters []string) (url.Values, error) {
+ parsedFilters := make(url.Values)
+ for _, f := range filters {
+ t := strings.SplitN(f, "=", 2)
+ if len(t) < 2 {
+ return parsedFilters, errors.Errorf("filter input must be in the form of filter=value: %s is invalid", f)
+ }
+ parsedFilters.Add(t[0], t[1])
+ }
+ return parsedFilters, nil
+}