1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/pkg/utils/match/annotations.go
Charles-Edouard Brétéché c96199dee1
chore: move utils/wildcard in ext (#8772)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-10-29 23:59:53 +00:00

24 lines
416 B
Go

package match
import (
"github.com/kyverno/kyverno/ext/wildcard"
)
func CheckAnnotations(expected map[string]string, actual map[string]string) bool {
if len(expected) == 0 {
return true
}
for k, v := range expected {
match := false
for k1, v1 := range actual {
if wildcard.Match(k, k1) && wildcard.Match(v, v1) {
match = true
break
}
}
if !match {
return false
}
}
return true
}