From 7def91910c07ee3782b2106f76877d57d646f9b4 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Sun, 29 Mar 2020 14:46:35 -0500 Subject: podmanv2 pod ps add the ability to list pods in podmanv2 Signed-off-by: Brent Baude --- pkg/api/handlers/utils/pods.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg/api/handlers/utils') diff --git a/pkg/api/handlers/utils/pods.go b/pkg/api/handlers/utils/pods.go index 79d1a5090..d47053eda 100644 --- a/pkg/api/handlers/utils/pods.go +++ b/pkg/api/handlers/utils/pods.go @@ -59,6 +59,10 @@ func GetPods(w http.ResponseWriter, r *http.Request) ([]*entities.ListPodsReport if err != nil { return nil, err } + infraId, err := pod.InfraContainerID() + if err != nil { + return nil, err + } lp := entities.ListPodsReport{ Cgroup: pod.CgroupParent(), Created: pod.CreatedTime(), @@ -66,6 +70,7 @@ func GetPods(w http.ResponseWriter, r *http.Request) ([]*entities.ListPodsReport Name: pod.Name(), Namespace: pod.Namespace(), Status: status, + InfraId: infraId, } for _, ctr := range ctrs { state, err := ctr.State() -- cgit v1.2.3-54-g00ecf