summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-12-02 16:12:47 +0100
committerGitHub <noreply@github.com>2021-12-02 16:12:47 +0100
commitee39281c35e3ceca98c0c51c9cc5d792c56ba533 (patch)
tree0cbbc1d7e0222118bb32bbc90adf443602d40985 /pkg
parentb41026aec77fc7b74a45560f242be66c25af59a6 (diff)
parent2683ecbbcda750b9339713ced9b974b9dd61b9aa (diff)
downloadpodman-ee39281c35e3ceca98c0c51c9cc5d792c56ba533.tar.gz
podman-ee39281c35e3ceca98c0c51c9cc5d792c56ba533.tar.bz2
podman-ee39281c35e3ceca98c0c51c9cc5d792c56ba533.zip
Merge pull request #12480 from vrothberg/fix-12453
compat: images/json
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/compat/images.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/images.go b/pkg/api/handlers/compat/images.go
index af8b6b63d..4533fddeb 100644
--- a/pkg/api/handlers/compat/images.go
+++ b/pkg/api/handlers/compat/images.go
@@ -409,14 +409,20 @@ 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([]*entities.ImageSummary, len(images))
- for j, img := range images {
+
+ summaries := make([]*entities.ImageSummary, 0, len(images))
+ for _, img := range images {
+ // If the image is a manifest list, extract as much as we can.
+ if isML, _ := img.IsManifestList(r.Context()); isML {
+ continue
+ }
+
is, err := handlers.ImageToImageSummary(img)
if err != nil {
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "Failed transform image summaries"))
return
}
- summaries[j] = is
+ summaries = append(summaries, is)
}
utils.WriteResponse(w, http.StatusOK, summaries)
}