-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Closed
Closed
Copy link
Labels
area/imagesImage DistributionImage Distributioncontainerd-integrationIssues and PRs related to containerd integrationIssues and PRs related to containerd integration
Milestone
Description
Description
Images may be present in the local image cache without having been pushed and/or tagged ("dangling").
The new code unconditionally includes RepoDigests and RepoTags;
moby/daemon/containerd/image_list.go
Lines 59 to 60 in 98d8343
| RepoDigests: []string{img.Name() + "@" + img.Target().Digest.String()}, // "hello-world@sha256:bfea6278a0a267fad2634554f4f0c6f31981eea41c553fdf5a83e95a41d40c38"}, | |
| RepoTags: []string{img.Name()}, |
But also assumes an image always has a single tag (which may not be the case, e.g. ubuntu:latest and ubuntu:22.04 may be the same image).
The old code accounts for this situation, and (for backward compatibility) returns <none>:<none> as name/tag;
moby/daemon/images/image_list.go
Lines 152 to 167 in 7624f8a
| if summary.RepoDigests == nil && summary.RepoTags == nil { | |
| if opts.All || len(i.imageStore.Children(id)) == 0 { | |
| if opts.Filters.Contains("dangling") && !danglingOnly { | |
| // dangling=false case, so dangling image is not needed | |
| continue | |
| } | |
| if opts.Filters.Contains("reference") { // skip images with no references if filtering by reference | |
| continue | |
| } | |
| summary.RepoDigests = []string{"<none>@<none>"} | |
| summary.RepoTags = []string{"<none>:<none>"} | |
| } else { | |
| continue | |
| } | |
| } else if danglingOnly && len(summary.RepoTags) > 0 { |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/imagesImage DistributionImage Distributioncontainerd-integrationIssues and PRs related to containerd integrationIssues and PRs related to containerd integration
Type
Projects
Status
Done