mirror of
https://github.com/mudler/luet.git
synced 2025-09-21 11:08:08 +00:00
update vendor
This commit is contained in:
25
vendor/github.com/google/go-containerregistry/pkg/v1/match/match.go
generated
vendored
25
vendor/github.com/google/go-containerregistry/pkg/v1/match/match.go
generated
vendored
@@ -44,19 +44,24 @@ func Annotation(key, value string) Matcher {
|
||||
}
|
||||
}
|
||||
|
||||
// Platform returns a match.Matcher that matches on the provided platform.
|
||||
// Platforms returns a match.Matcher that matches on any one of the provided platforms.
|
||||
// Ignores any descriptors that do not have a platform.
|
||||
func Platform(platform v1.Platform) Matcher {
|
||||
func Platforms(platforms ...v1.Platform) Matcher {
|
||||
return func(desc v1.Descriptor) bool {
|
||||
if desc.Platform == nil {
|
||||
return false
|
||||
}
|
||||
return desc.Platform.Equals(platform)
|
||||
for _, platform := range platforms {
|
||||
if desc.Platform.Equals(platform) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// MediaTypes returns a match.Matcher that matches at least one of the provided media types.
|
||||
func MediaTypes(mediaTypes []string) Matcher {
|
||||
func MediaTypes(mediaTypes ...string) Matcher {
|
||||
mts := map[string]bool{}
|
||||
for _, media := range mediaTypes {
|
||||
mts[media] = true
|
||||
@@ -71,3 +76,15 @@ func MediaTypes(mediaTypes []string) Matcher {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Digests returns a match.Matcher that matches at least one of the provided Digests
|
||||
func Digests(digests ...v1.Hash) Matcher {
|
||||
digs := map[v1.Hash]bool{}
|
||||
for _, digest := range digests {
|
||||
digs[digest] = true
|
||||
}
|
||||
return func(desc v1.Descriptor) bool {
|
||||
_, ok := digs[desc.Digest]
|
||||
return ok
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user