summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorSteve Taylor <steven@taylormuff.co.uk>2020-03-05 22:37:31 +0000
committerSteve Taylor <steven@taylormuff.co.uk>2020-03-05 22:37:31 +0000
commit9088a8a387c365d635d2db305872747532fc3b5a (patch)
tree00b20d42b2267b7a7c5c8d1021f79bcc5a2c0e23 /pkg/api
parent89b083f8b409f24d2bfce793f150f79c8160dd95 (diff)
downloadpodman-9088a8a387c365d635d2db305872747532fc3b5a.tar.gz
podman-9088a8a387c365d635d2db305872747532fc3b5a.tar.bz2
podman-9088a8a387c365d635d2db305872747532fc3b5a.zip
Fix to remove null entry from end of images json
Signed-off-by: Steve Taylor <steven@taylormuff.co.uk>
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/generic/images.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/api/handlers/generic/images.go b/pkg/api/handlers/generic/images.go
index 1ced499d9..63f71eeff 100644
--- a/pkg/api/handlers/generic/images.go
+++ b/pkg/api/handlers/generic/images.go
@@ -305,7 +305,8 @@ func GetImages(w http.ResponseWriter, r *http.Request) {
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "Failed get images"))
return
}
- var summaries = make([]*handlers.ImageSummary, len(images)+1)
+ // +1 removed from len(images) as this leaves a null entry at the end of the image array
+ var summaries = make([]*handlers.ImageSummary, len(images))
for j, img := range images {
is, err := handlers.ImageToImageSummary(img)
if err != nil {