api/server: getImagesJSON(): don't check version in a loop
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
5bf405b2af
commit
9a9dfb1d0d
1 changed files with 2 additions and 1 deletions
|
@ -356,8 +356,9 @@ func (ir *imageRouter) getImagesJSON(ctx context.Context, w http.ResponseWriter,
|
|||
return err
|
||||
}
|
||||
|
||||
useNone := versions.LessThan(version, "1.43")
|
||||
for _, img := range images {
|
||||
if versions.LessThan(version, "1.43") {
|
||||
if useNone {
|
||||
if len(img.RepoTags) == 0 && len(img.RepoDigests) == 0 {
|
||||
img.RepoTags = append(img.RepoTags, "<none>:<none>")
|
||||
img.RepoDigests = append(img.RepoDigests, "<none>@<none>")
|
||||
|
|
Loading…
Add table
Reference in a new issue