summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/libpod
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-05-27 15:51:24 -0700
committerJhon Honce <jhonce@redhat.com>2020-05-28 16:20:29 -0700
commit5626c2163bff661540e1ae3a5df25f0c7e7573f6 (patch)
treec5fe7993722f72f96b2f49b1ce47e2bb99adc531 /pkg/api/handlers/libpod
parente8818ced806910f8ce44939fef08f89139be4119 (diff)
downloadpodman-5626c2163bff661540e1ae3a5df25f0c7e7573f6.tar.gz
podman-5626c2163bff661540e1ae3a5df25f0c7e7573f6.tar.bz2
podman-5626c2163bff661540e1ae3a5df25f0c7e7573f6.zip
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 <jhonce@redhat.com>
Diffstat (limited to 'pkg/api/handlers/libpod')
-rw-r--r--pkg/api/handlers/libpod/containers.go4
1 files changed, 4 insertions, 0 deletions
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)
}