mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-15 17:51:20 +00:00
03702476fa
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
16 lines
450 B
Go
16 lines
450 B
Go
package controller
|
|
|
|
import (
|
|
"github.com/kyverno/kyverno/api/kyverno"
|
|
"k8s.io/apimachinery/pkg/labels"
|
|
"k8s.io/apimachinery/pkg/selection"
|
|
)
|
|
|
|
func SelectorNotManagedByKyverno() (labels.Selector, error) {
|
|
selector := labels.Everything()
|
|
requirement, err := labels.NewRequirement(kyverno.LabelAppManagedBy, selection.NotEquals, []string{kyverno.ValueKyvernoApp})
|
|
if err == nil {
|
|
selector = selector.Add(*requirement)
|
|
}
|
|
return selector, err
|
|
}
|