mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
c96199dee1
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
17 lines
347 B
Go
17 lines
347 B
Go
package kube
|
|
|
|
import (
|
|
"github.com/kyverno/kyverno/ext/wildcard"
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
)
|
|
|
|
func LabelSelectorContainsWildcard(v *metav1.LabelSelector) bool {
|
|
if v != nil {
|
|
for k, v := range v.MatchLabels {
|
|
if wildcard.ContainsWildcard(k) || wildcard.ContainsWildcard(v) {
|
|
return true
|
|
}
|
|
}
|
|
}
|
|
return false
|
|
}
|