From 5af8077eeb25734cd5f6fbc50868c140c7580f51 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 89553d1048..a84bd08e41 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] == "@" }