Skip to content

Commit 0f9f062

Browse files
authored
Merge pull request containerd#3853 from apostasie/fix-3852
Prevent reference filter from failing on dangling images
2 parents 8ef14b7 + 3863614 commit 0f9f062

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/imgutil/filtering.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,11 @@ func matchesAllLabels(imageCfgLabels map[string]string, filterLabels map[string]
325325
func matchesReferences(image images.Image, referencePatterns []string) (bool, error) {
326326
var matches int
327327

328+
// Containerd returns ":" for dangling untagged images - see https://github.com/containerd/nerdctl/issues/3852
329+
if image.Name == ":" {
330+
return false, nil
331+
}
332+
328333
parsedReference, err := referenceutil.Parse(image.Name)
329334
if err != nil {
330335
return false, err

0 commit comments

Comments
 (0)