1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 07:57:07 +00:00
kyverno/pkg/utils/report/support.go

21 lines
590 B
Go
Raw Normal View History

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
}