Write a clear and concise description that helps reviewers understand the purpose and impact of your changes. Use the
following format:
Problem: User wants ObservabilityPolicy CRD should require a minimum of 1 TargetRef.
Solution: Add validation to have minimum one target ref for the ObservabilityPolicy CRDs.
Testing:
Tested manually using the example. Installed observabilityPolicy with on branch main, a target ref and ensuring everything works as expected.
Tested with specifying no target refs
kubectl apply -f - <<EOF
apiVersion: gateway.nginx.org/v1alpha1
kind: ObservabilityPolicy
metadata:
name: coffee
spec:
targetRefs: []
tracing:
strategy: ratio
ratio: 75
spanAttributes:
- key: coffee-key
value: coffee-value
EOF
The ObservabilityPolicy "coffee" is invalid:
* spec.targetRefs: Invalid value: 0: spec.targetRefs in body should have at least 1 items
* spec.targetRefs: Invalid value: "array": TargetRef Kind must be: HTTPRoute or GRPCRoute
Please focus on (optional): If you any specific areas where you would like reviewers to focus their attention or provide
specific feedback, add them here.
Closes #2524
Checklist
Before creating a PR, run through this checklist and mark each as complete.
Proposed changes
Write a clear and concise description that helps reviewers understand the purpose and impact of your changes. Use the following format:
Problem: User wants ObservabilityPolicy CRD should require a minimum of 1 TargetRef.
Solution: Add validation to have minimum one target ref for the ObservabilityPolicy CRDs.
Testing:
Tested manually using the example. Installed observabilityPolicy with on branch
main
, a target ref and ensuring everything works as expected.Tested with specifying no target refs
Please focus on (optional): If you any specific areas where you would like reviewers to focus their attention or provide specific feedback, add them here.
Closes #2524
Checklist
Before creating a PR, run through this checklist and mark each as complete.
Release notes
If this PR introduces a change that affects users and needs to be mentioned in the release notes, please add a brief note that summarizes the change.