MCPcopy Create free account
hub / github.com/containers/image / imageMatchesRepo

Function imageMatchesRepo

storage/storage_reference.go:54–62  ·  view source on GitHub ↗

imageMatchesRepo returns true iff image.Names contains an element with the same repo as ref

(image *storage.Image, ref reference.Named)

Source from the content-addressed store, hash-verified

52
53// imageMatchesRepo returns true iff image.Names contains an element with the same repo as ref
54func imageMatchesRepo(image *storage.Image, ref reference.Named) bool {
55 repo := ref.Name()
56 return slices.ContainsFunc(image.Names, func(name string) bool {
57 if named, err := reference.ParseNormalizedNamed(name); err == nil && named.Name() == repo {
58 return true
59 }
60 return false
61 })
62}
63
64// multiArchImageMatchesSystemContext returns true if the passed-in image both contains a
65// multi-arch manifest that matches the passed-in digest, and the image is the per-platform

Callers 1

resolveImageMethod · 0.85

Calls 2

ParseNormalizedNamedFunction · 0.92
NameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…