Skip to content

Commit 67f5e34

Browse files
committed
image: Fix dangling image detection with graphdrivers
The isDangling function was incorrectly identifying images as dangling when they had no RepoTags but had valid RepoDigests. This can occur when the graphdrivers are used instead of the containerd image store. An image should only be considered dangling if it has no RepoTags, regardless of whether it has RepoDigests. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
1 parent d96b786 commit 67f5e34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎cli/command/image/list.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func shouldUseTree(options imagesOptions) (bool, error) {
177177

178178
// isDangling is a copy of [formatter.isDangling].
179179
func isDangling(img image.Summary) bool {
180-
if len(img.RepoTags) == 0 && len(img.RepoDigests) == 0 {
180+
if len(img.RepoTags) == 0 {
181181
return true
182182
}
183183
return len(img.RepoTags) == 1 && img.RepoTags[0] == "<none>:<none>" && len(img.RepoDigests) == 1 && img.RepoDigests[0] == "<none>@<none>"

0 commit comments

Comments
 (0)