summaryrefslogtreecommitdiff
path: root/pkg/domain/infra
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-11-18 18:55:05 +0100
committerGitHub <noreply@github.com>2020-11-18 18:55:05 +0100
commit61a82159dbb154b2044595b156dbdb9fac04bedd (patch)
tree55a9809a4eb587344f80e702eab7b4b5609995ac /pkg/domain/infra
parentdcd498a6885f0293934214af0c6fc2d3c7717bd5 (diff)
parent4f427a89cbc0814c25dd4b562ddf4ff4e568a005 (diff)
downloadpodman-61a82159dbb154b2044595b156dbdb9fac04bedd.tar.gz
podman-61a82159dbb154b2044595b156dbdb9fac04bedd.tar.bz2
podman-61a82159dbb154b2044595b156dbdb9fac04bedd.zip
Merge pull request #8376 from Luap99/podman-filters
Align the podman ps --filter behavior with docker
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r--pkg/domain/infra/abi/containers.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go
index 855f9ece8..4b69ac74e 100644
--- a/pkg/domain/infra/abi/containers.go
+++ b/pkg/domain/infra/abi/containers.go
@@ -205,15 +205,13 @@ func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []strin
}
func (ic *ContainerEngine) ContainerPrune(ctx context.Context, options entities.ContainerPruneOptions) (*entities.ContainerPruneReport, error) {
- var filterFuncs []libpod.ContainerFilter
+ filterFuncs := make([]libpod.ContainerFilter, 0, len(options.Filters))
for k, v := range options.Filters {
- for _, val := range v {
- generatedFunc, err := lpfilters.GenerateContainerFilterFuncs(k, val, ic.Libpod)
- if err != nil {
- return nil, err
- }
- filterFuncs = append(filterFuncs, generatedFunc)
+ generatedFunc, err := lpfilters.GenerateContainerFilterFuncs(k, v, ic.Libpod)
+ if err != nil {
+ return nil, err
}
+ filterFuncs = append(filterFuncs, generatedFunc)
}
return ic.pruneContainersHelper(filterFuncs)
}