summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r--pkg/domain/infra/abi/pods.go17
1 files changed, 7 insertions, 10 deletions
diff --git a/pkg/domain/infra/abi/pods.go b/pkg/domain/infra/abi/pods.go
index 258640a81..11374e513 100644
--- a/pkg/domain/infra/abi/pods.go
+++ b/pkg/domain/infra/abi/pods.go
@@ -282,20 +282,17 @@ func (ic *ContainerEngine) PodTop(ctx context.Context, options entities.PodTopOp
func (ic *ContainerEngine) PodPs(ctx context.Context, options entities.PodPSOptions) ([]*entities.ListPodsReport, error) {
var (
- err error
- filters = []libpod.PodFilter{}
- pds = []*libpod.Pod{}
+ err error
+ pds = []*libpod.Pod{}
)
+ filters := make([]libpod.PodFilter, 0, len(options.Filters))
for k, v := range options.Filters {
- for _, filter := range v {
- f, err := lpfilters.GeneratePodFilterFunc(k, filter)
- if err != nil {
- return nil, err
- }
- filters = append(filters, f)
-
+ f, err := lpfilters.GeneratePodFilterFunc(k, v)
+ if err != nil {
+ return nil, err
}
+ filters = append(filters, f)
}
if options.Latest {
pod, err := ic.Libpod.GetLatestPod()