mirror of
https://github.com/containers/podman.git
synced 2025-10-26 02:35:43 +08:00
Merge pull request #8724 from bblenard/support-volume-filters-in-system-prune
Add volume filters to system prune
This commit is contained in:
20
libpod/filters/helpers.go
Normal file
20
libpod/filters/helpers.go
Normal file
@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user