mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00

This change was missed in pull/8689. Now that volume pruneing supports filters system pruneing can pass its filters down to the volume pruneing. Additionally this change adds tests for the following components * podman system prune subcommand with `--volumes` & `--filter` options * apiv2 api tests for `/system/` and `/libpod/system` endpoints Relates to #8453, #8672 Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
21 lines
448 B
Go
21 lines
448 B
Go
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
|
|
}
|