Bläddra i källkod

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

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Paweł Gronowski 2 år sedan
förälder
incheckning
2f9e3cca3d
2 ändrade filer med 7 tillägg och 2 borttagningar
  1. 7 0
      api/server/router/image/image_routes.go
  2. 0 2
      daemon/images/image_list.go

+ 7 - 0
api/server/router/image/image_routes.go

@@ -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)
 }
 

+ 0 - 2
daemon/images/image_list.go

@@ -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
 			}