mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-09 09:26:54 +00:00
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com> Co-authored-by: shuting <shuting@nirmata.com>
15 lines
346 B
Go
15 lines
346 B
Go
package kube
|
|
|
|
import (
|
|
stringutils "github.com/kyverno/kyverno/pkg/utils/string"
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
)
|
|
|
|
func LabelSelectorContainsWildcard(v *metav1.LabelSelector) bool {
|
|
for k, v := range v.MatchLabels {
|
|
if stringutils.ContainsWildcard(k) || stringutils.ContainsWildcard(v) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|