Skip to content

🌱 Replace manual XValidation CEL rule with ExactlyOneOf marker on ClusterObjectSetObject#2620

Merged
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
pedjak:exactly-one-of-marker
Apr 1, 2026
Merged

🌱 Replace manual XValidation CEL rule with ExactlyOneOf marker on ClusterObjectSetObject#2620
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
pedjak:exactly-one-of-marker

Conversation

@pedjak
Copy link
Copy Markdown
Contributor

@pedjak pedjak commented Apr 1, 2026

Description

Replace the hand-written CEL XValidation rule on ClusterObjectSetObject with 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

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

…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>
Copilot AI review requested due to automatic review settings April 1, 2026 14:11
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 1, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 949cd57
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/69cd2786a9b3af00080a86a8
😎 Deploy Preview https://deploy-preview-2620--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@openshift-ci openshift-ci bot requested review from grokspawn and trgeiger April 1, 2026 14:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 XValidation rule/message for ExactlyOneOf marker on ClusterObjectSetObject in 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
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.84%. Comparing base (95ef574) to head (949cd57).
⚠️ Report is 3 commits behind head on main.

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     
Flag Coverage Δ
e2e 37.63% <ø> (-0.03%) ⬇️
experimental-e2e 52.20% <ø> (-0.05%) ⬇️
unit 53.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great 🎉

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 1, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 1, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 1, 2026
@openshift-merge-bot openshift-merge-bot bot merged commit 614a5ea into operator-framework:main Apr 1, 2026
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-diff-lint-override approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants