From 47a3dad256e9ec6f4a2494cabc189ae709265d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Fri, 19 May 2023 18:11:25 +0200 Subject: [PATCH] c8d/list: Show layerless images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Gronowski (cherry picked from commit 34964c2454e32295866a1920a4d50982d10f7ab4) Signed-off-by: Paweł Gronowski --- daemon/containerd/image_list.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/containerd/image_list.go b/daemon/containerd/image_list.go index 72cca0d18a..9128f88797 100644 --- a/daemon/containerd/image_list.go +++ b/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