From 5626c2163bff661540e1ae3a5df25f0c7e7573f6 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Wed, 27 May 2020 15:51:24 -0700 Subject: V2 verify JSON output is consistent and doesn't drift $ cd test/apiv2 $ python -m unittest -v test_rest_v1_0_0.TestApi Signed-off-by: Jhon Honce --- pkg/api/handlers/libpod/containers.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg/api/handlers/libpod') diff --git a/pkg/api/handlers/libpod/containers.go b/pkg/api/handlers/libpod/containers.go index 3902bdc9b..50f6b1a38 100644 --- a/pkg/api/handlers/libpod/containers.go +++ b/pkg/api/handlers/libpod/containers.go @@ -66,6 +66,10 @@ func ListContainers(w http.ResponseWriter, r *http.Request) { utils.InternalServerError(w, err) return } + if len(pss) == 0 { + utils.WriteResponse(w, http.StatusOK, "[]") + return + } utils.WriteResponse(w, http.StatusOK, pss) } -- cgit v1.2.3-54-g00ecf