From a6412f81cdbb268fdfa997c50bc749e835c24730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Thu, 23 Feb 2023 16:02:25 +0100 Subject: [PATCH] formatter: Consider empty RepoTags and RepoDigests as dangling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Gronowski (cherry picked from commit 89687d5b3f11af6848d325b4d096aa639445cb8d) --- cli/command/formatter/image.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cli/command/formatter/image.go b/cli/command/formatter/image.go index 384b35dc19..6d9f6d7307 100644 --- a/cli/command/formatter/image.go +++ b/cli/command/formatter/image.go @@ -27,6 +27,9 @@ type ImageContext struct { } func isDangling(image types.ImageSummary) bool { + if len(image.RepoTags) == 0 && len(image.RepoDigests) == 0 { + return true + } return len(image.RepoTags) == 1 && image.RepoTags[0] == ":" && len(image.RepoDigests) == 1 && image.RepoDigests[0] == "@" }