Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ObservabilityPolicy API to have minimum one target ref #2753

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apis/v1alpha1/observabilitypolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type ObservabilityPolicySpec struct {
// Objects must be in the same namespace as the policy.
// Support: HTTPRoute, GRPCRoute.
//
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=16
// +kubebuilder:validation:XValidation:message="TargetRef Kind must be: HTTPRoute or GRPCRoute",rule="(self.exists(t, t.kind=='HTTPRoute') || self.exists(t, t.kind=='GRPCRoute'))"
// +kubebuilder:validation:XValidation:message="TargetRef Group must be gateway.networking.k8s.io.",rule="self.all(t, t.group=='gateway.networking.k8s.io')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ spec:
- name
type: object
maxItems: 16
minItems: 1
type: array
x-kubernetes-validations:
- message: 'TargetRef Kind must be: HTTPRoute or GRPCRoute'
Expand Down
1 change: 1 addition & 0 deletions deploy/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,7 @@ spec:
- name
type: object
maxItems: 16
minItems: 1
type: array
x-kubernetes-validations:
- message: 'TargetRef Kind must be: HTTPRoute or GRPCRoute'
Expand Down
Loading