summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-26 13:34:18 +0200
committerGitHub <noreply@github.com>2020-04-26 13:34:18 +0200
commit13c1d2c6af211ade30eeb01d02af7fbf94f2582d (patch)
tree1f34dfb751a4725b002ceb5b8240a1fc79ae188e /pkg
parent2afe579c064923841a55d57458fac4d91bec8173 (diff)
parent942a3ef588c01e60bcaed94d32547219b15fd0ab (diff)
downloadpodman-13c1d2c6af211ade30eeb01d02af7fbf94f2582d.tar.gz
podman-13c1d2c6af211ade30eeb01d02af7fbf94f2582d.tar.bz2
podman-13c1d2c6af211ade30eeb01d02af7fbf94f2582d.zip
Merge pull request #5982 from baude/v2intpodps
Enable pod ps integration tests
Diffstat (limited to 'pkg')
-rw-r--r--pkg/domain/infra/abi/pods.go18
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()