🌱 Replace manual XValidation CEL rule with ExactlyOneOf marker on ClusterObjectSetObject#2620
Conversation
…ClusterObjectSetObject
Use the +kubebuilder:validation:ExactlyOneOf={object,ref} marker
introduced in controller-tools v0.19.0 instead of a hand-written
CEL XValidation rule. The generated CEL expression is semantically
equivalent.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Replaces the manual CEL-based XValidation on ClusterObjectSetObject with the +kubebuilder:validation:ExactlyOneOf={object,ref} marker and updates the generated CRD manifests accordingly.
Changes:
- Swapped
XValidationrule/message forExactlyOneOfmarker onClusterObjectSetObjectin the Go API type. - Regenerated experimental CRD manifests to use the controller-tools-generated CEL expression and message.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| manifests/experimental.yaml | Updates CRD x-kubernetes-validations rule/message to the ExactlyOneOf-generated CEL expression. |
| manifests/experimental-e2e.yaml | Mirrors the same generated validation update for the e2e manifest variant. |
| helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterobjectsets.yaml | Updates the Helm-packaged CRD with the new generated rule/message. |
| api/v1/clusterobjectset_types.go | Replaces manual XValidation marker with +kubebuilder:validation:ExactlyOneOf={object,ref}. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2620 +/- ##
==========================================
- Coverage 68.86% 68.84% -0.03%
==========================================
Files 139 139
Lines 9902 9902
==========================================
- Hits 6819 6817 -2
- Misses 2572 2573 +1
- Partials 511 512 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
614a5ea
into
operator-framework:main
Description
Replace the hand-written CEL XValidation rule on
ClusterObjectSetObjectwith the+kubebuilder:validation:ExactlyOneOf={object,ref}marker introduced in controller-tools v0.19.0.The generated CEL expression (
[has(self.object),has(self.ref)].filter(x,x==true).size() == 1)is semantically equivalent to the previous rule (
has(self.object) != has(self.ref)).Reviewer Checklist