api: Move Repo(Digests|Tags) <none> fallback from daemon

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2023-02-22 16:31:32 +01:00
parent 432390c4c4
commit 2f9e3cca3d
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A
2 changed files with 7 additions and 2 deletions

View file

@ -337,6 +337,13 @@ func (ir *imageRouter) getImagesJSON(ctx context.Context, w http.ResponseWriter,
return err
}
for _, img := range images {
if len(img.RepoTags) == 0 && len(img.RepoDigests) == 0 {
img.RepoTags = append(img.RepoTags, "<none>:<none>")
img.RepoDigests = append(img.RepoDigests, "<none>@<none>")
}
}
return httputils.WriteJSON(w, http.StatusOK, images)
}

View file

@ -178,8 +178,6 @@ func (i *ImageService) Images(ctx context.Context, opts types.ImageListOptions)
if opts.Filters.Contains("reference") { // skip images with no references if filtering by reference
continue
}
summary.RepoDigests = []string{"<none>@<none>"}
summary.RepoTags = []string{"<none>:<none>"}
} else {
continue
}