diff options
author | Brent Baude <bbaude@redhat.com> | 2020-04-25 13:11:08 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-04-25 13:13:32 -0500 |
commit | 942a3ef588c01e60bcaed94d32547219b15fd0ab (patch) | |
tree | 1f34dfb751a4725b002ceb5b8240a1fc79ae188e /pkg/domain/infra/abi/pods.go | |
parent | 2afe579c064923841a55d57458fac4d91bec8173 (diff) | |
download | podman-942a3ef588c01e60bcaed94d32547219b15fd0ab.tar.gz podman-942a3ef588c01e60bcaed94d32547219b15fd0ab.tar.bz2 podman-942a3ef588c01e60bcaed94d32547219b15fd0ab.zip |
Enable pod ps integration tests
Enable integration tests for pod ps.
In addition, fixed bug where output was still using slice go template routines and would fail when no infra container was present. Added integration test to prevent future regressions.
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi/pods.go')
-rw-r--r-- | pkg/domain/infra/abi/pods.go | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/pkg/domain/infra/abi/pods.go b/pkg/domain/infra/abi/pods.go index c4ae9efbf..7732d5aa3 100644 --- a/pkg/domain/infra/abi/pods.go +++ b/pkg/domain/infra/abi/pods.go @@ -292,9 +292,12 @@ 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 reports []*entities.ListPodsReport ) + for k, v := range options.Filters { for _, filter := range v { f, err := lpfilters.GeneratePodFilterFunc(k, filter) @@ -305,10 +308,19 @@ func (ic *ContainerEngine) PodPs(ctx context.Context, options entities.PodPSOpti } } - pds, err := ic.Libpod.Pods(filters...) - if err != nil { - return nil, err + if options.Latest { + pod, err := ic.Libpod.GetLatestPod() + if err != nil { + return nil, err + } + pds = append(pds, pod) + } else { + pds, err = ic.Libpod.Pods(filters...) + if err != nil { + return nil, err + } } + for _, p := range pds { var lpcs []*entities.ListPodContainer status, err := p.GetPodStatus() |