diff options
author | Jakub Guzik <jakubmguzik@gmail.com> | 2021-06-03 22:48:43 +0200 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2021-06-11 13:06:06 -0400 |
commit | f1e7a07473958a9ba0f06f7c2f88105200f7a146 (patch) | |
tree | 6007e99f6606ae26f5791d848a532cee7f8fbe52 /cmd/podman | |
parent | 5ddd76edd02dd59c2306e1ed12ad7ff2001dc38a (diff) | |
download | podman-f1e7a07473958a9ba0f06f7c2f88105200f7a146.tar.gz podman-f1e7a07473958a9ba0f06f7c2f88105200f7a146.tar.bz2 podman-f1e7a07473958a9ba0f06f7c2f88105200f7a146.zip |
Fix image prune --filter cmd behavior
Image prune --filter is fully implemented in the api, http api
yet not connected with the cli execution. User trying to use
filters does not see the effect. This commit adds glue code to enable
possiblity of using --filter in prune in the cli execution.
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/images/prune.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/podman/images/prune.go b/cmd/podman/images/prune.go index db645cc2e..52217c0d6 100644 --- a/cmd/podman/images/prune.go +++ b/cmd/podman/images/prune.go @@ -60,7 +60,15 @@ func prune(cmd *cobra.Command, args []string) error { return nil } } - + filterMap, err := common.ParseFilters(filter) + if err != nil { + return err + } + for k, v := range filterMap { + for _, val := range v { + pruneOpts.Filter = append(pruneOpts.Filter, fmt.Sprintf("%s=%s", k, val)) + } + } results, err := registry.ImageEngine().Prune(registry.GetContext(), pruneOpts) if err != nil { return err |