diff --git a/apis/v1alpha1/clientsettingspolicy_types.go b/apis/v1alpha1/clientsettingspolicy_types.go index fe7cdcca9d..dbac5a7115 100644 --- a/apis/v1alpha1/clientsettingspolicy_types.go +++ b/apis/v1alpha1/clientsettingspolicy_types.go @@ -41,6 +41,7 @@ type ClientSettingsPolicySpec struct { // Support: Gateway, HTTPRoute, GRPCRoute. // // +kubebuilder:validation:XValidation:message="TargetRef Kind must be one of: Gateway, HTTPRoute, or GRPCRoute",rule="(self.kind=='Gateway' || self.kind=='HTTPRoute' || self.kind=='GRPCRoute')" + // +kubebuilder:validation:XValidation:message="TargetRef Group must be gateway.networking.k8s.io.",rule="(self.group=='gateway.networking.k8s.io')" //nolint:lll TargetRef gatewayv1alpha2.PolicyTargetReference `json:"targetRef"` diff --git a/config/crd/bases/gateway.nginx.org_clientsettingspolicies.yaml b/config/crd/bases/gateway.nginx.org_clientsettingspolicies.yaml index 6fda1b06f1..8ee29cbe58 100644 --- a/config/crd/bases/gateway.nginx.org_clientsettingspolicies.yaml +++ b/config/crd/bases/gateway.nginx.org_clientsettingspolicies.yaml @@ -153,6 +153,8 @@ spec: - message: 'TargetRef Kind must be one of: Gateway, HTTPRoute, or GRPCRoute' rule: (self.kind=='Gateway' || self.kind=='HTTPRoute' || self.kind=='GRPCRoute') + - message: TargetRef Group must be gateway.networking.k8s.io. + rule: (self.group=='gateway.networking.k8s.io') required: - targetRef type: object diff --git a/deploy/crds.yaml b/deploy/crds.yaml index 833fb5acc6..4fca0b3251 100644 --- a/deploy/crds.yaml +++ b/deploy/crds.yaml @@ -152,6 +152,8 @@ spec: - message: 'TargetRef Kind must be one of: Gateway, HTTPRoute, or GRPCRoute' rule: (self.kind=='Gateway' || self.kind=='HTTPRoute' || self.kind=='GRPCRoute') + - message: TargetRef Group must be gateway.networking.k8s.io. + rule: (self.group=='gateway.networking.k8s.io') required: - targetRef type: object