mirror of
https://github.com/containers/podman.git
synced 2025-07-14 10:09:13 +08:00
Merge pull request #7395 from zhangguanzhang/libpod-api-returns-null
fix /libpod/pods/json returns null when there are no pods
This commit is contained in:
@ -45,7 +45,7 @@ func GetPods(w http.ResponseWriter, r *http.Request) ([]*entities.ListPodsReport
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(pods) == 0 {
|
if len(pods) == 0 {
|
||||||
return nil, nil
|
return []*entities.ListPodsReport{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
lps := make([]*entities.ListPodsReport, 0, len(pods))
|
lps := make([]*entities.ListPodsReport, 0, len(pods))
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# test pod-related endpoints
|
# test pod-related endpoints
|
||||||
#
|
#
|
||||||
|
|
||||||
t GET "libpod/pods/json (clean slate at start)" 200 null
|
t GET "libpod/pods/json (clean slate at start)" 200 '[]'
|
||||||
|
|
||||||
t POST libpod/pods/create name=foo 201 .Id~[0-9a-f]\\{64\\}
|
t POST libpod/pods/create name=foo 201 .Id~[0-9a-f]\\{64\\}
|
||||||
pod_id=$(jq -r .Id <<<"$output")
|
pod_id=$(jq -r .Id <<<"$output")
|
||||||
|
Reference in New Issue
Block a user