🌱 Add CheckObjectSupport bundle validator#2523
🌱 Add CheckObjectSupport bundle validator#2523perdasilva wants to merge 1 commit intooperator-framework:mainfrom
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
122451c to
95bcd69
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a new bundle validator CheckObjectSupport to ensure that non-CRD and non-CSV bundle objects use only supported Kubernetes resource kinds according to the registry+v1 standard. The validator leverages the existing IsSupported function from operator-registry to check each object kind, providing early validation feedback before bundle generation.
Changes:
- Added
CheckObjectSupportvalidator function that validates bundle objects against the registry+v1 supported resources list - Added comprehensive unit tests covering empty bundles, supported kinds, unsupported kinds, multiple errors, and mixed scenarios
- Added helper function
newUnstructuredObjectto simplify test object creation
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/operator-controller/rukpak/render/registryv1/validators/validator.go | Implements the CheckObjectSupport validator that rejects unsupported object kinds |
| internal/operator-controller/rukpak/render/registryv1/validators/validator_test.go | Adds comprehensive unit tests and test helper for the new validator |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/operator-controller/rukpak/render/registryv1/validators/validator.go
Show resolved
Hide resolved
252a69b to
2088abd
Compare
Add a validator that checks non-CRD and non-CSV bundle objects are of kinds supported by the registry+v1 standard, using operator-registry's Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
2088abd to
784e40b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2523 +/- ##
==========================================
- Coverage 72.15% 72.10% -0.05%
==========================================
Files 103 103
Lines 8686 8693 +7
==========================================
+ Hits 6267 6268 +1
- Misses 1937 1944 +7
+ Partials 482 481 -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:
|
Summary
CheckObjectSupportvalidator that rejects non-CRD/non-CSV bundle objects whose kind is not in the registry+v1 supported resources list (viaoperator-registry'sIsSupported)Test plan
CheckObjectSupport🤖 Generated with Claude Code