mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 07:57:07 +00:00
21 lines
590 B
Go
21 lines
590 B
Go
|
package report
|
||
|
|
||
|
import (
|
||
|
corev1 "k8s.io/api/core/v1"
|
||
|
eventsv1 "k8s.io/api/events/v1"
|
||
|
eventsv1beta1 "k8s.io/api/events/v1beta1"
|
||
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||
|
)
|
||
|
|
||
|
// bannedOwners are GVKs that are not allowed to be owners of other resources
|
||
|
var bannedOwners = map[schema.GroupVersionKind]struct{}{
|
||
|
corev1.SchemeGroupVersion.WithKind("Event"): {},
|
||
|
eventsv1.SchemeGroupVersion.WithKind("Event"): {},
|
||
|
eventsv1beta1.SchemeGroupVersion.WithKind("Event"): {},
|
||
|
}
|
||
|
|
||
|
func IsGvkSupported(gvk schema.GroupVersionKind) bool {
|
||
|
_, exists := bannedOwners[gvk]
|
||
|
return !exists
|
||
|
}
|