瀏覽代碼

Merge pull request #45588 from vvoland/c8d-layerless-24

[24.0 backport] c8d/list: Show layerless images
Bjorn Neergaard 2 年之前
父節點
當前提交
463850e59e
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      daemon/containerd/image_list.go

+ 4 - 1
daemon/containerd/image_list.go

@@ -525,9 +525,12 @@ func getManifestPlatform(ctx context.Context, store content.Provider, manifestDe
 	return platforms.Normalize(platform), nil
 }
 
-// isImageManifest returns true if the manifest has any layer that is a known image layer.
+// isImageManifest returns true if the manifest has no layers or any of its layers is a known image layer.
 // Some manifests use the image media type for compatibility, even if they are not a real image.
 func isImageManifest(mfst v1.Manifest) bool {
+	if len(mfst.Layers) == 0 {
+		return true
+	}
 	for _, l := range mfst.Layers {
 		if images.IsLayerType(l.MediaType) {
 			return true