🐛 Set owner-kind label on ClusterExtensionRevision resources#2480
Conversation
✅ 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
This PR adds the owner-kind label to ClusterExtensionRevision resources to ensure they are properly labeled with both owner-kind and owner-name. Previously, only the owner-name label was set on the ClusterExtensionRevision resource itself, while the owner-kind label was only applied to objects within the revision.
Changes:
- Added
labels.OwnerKindKey(ClusterExtension) to ClusterExtensionRevision metadata in thebuildClusterExtensionRevisionfunction - Refactored duplicate label merging logic into a new
mergeLabelMapsutility function - Updated test expectations to verify the presence of both owner-kind and owner-name labels
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/operator-controller/applier/boxcutter.go | Added owner-kind label to ClusterExtensionRevision metadata and introduced mergeLabelMaps utility function to consolidate label merging logic |
| internal/operator-controller/applier/boxcutter_test.go | Updated test expectations to include the new owner-kind label in ClusterExtensionRevision assertions |
💡 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 #2480 +/- ##
==========================================
+ Coverage 69.70% 69.74% +0.04%
==========================================
Files 102 102
Lines 8451 8449 -2
==========================================
+ Hits 5891 5893 +2
+ Misses 2089 2087 -2
+ Partials 471 469 -2
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:
|
525f70c to
3a0c9f6
Compare
|
[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 |
3a0c9f6 to
13b560d
Compare
|
New changes are detected. LGTM label has been removed. |
Add the owner-kind label to ClusterExtensionRevision resources to ensure they are properly labeled with both owner-kind and owner-name. Previously, only the owner-name label was set on the ClusterExtensionRevision resource itself. The owner-kind label was only applied to objects within the revision, but not to the revision resource. This change updates the buildClusterExtensionRevision function to set both labels.OwnerKindKey (ClusterExtension) and labels.OwnerNameKey on the ClusterExtensionRevision metadata. Also fixed variable name collision where local variable 'labels' shadowed the imported 'labels' package by renaming it to 'mergedLabels'. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com>
13b560d to
9f70e10
Compare
| sc.Step(`^(?i)ClusterExtensionRevision "([^"]+)" contains annotation "([^"]+)" with value$`, ClusterExtensionRevisionHasAnnotationWithValue) | ||
| sc.Step(`^(?i)ClusterExtensionRevision "([^"]+)" has label "([^"]+)" with value "([^"]+)"$`, ClusterExtensionRevisionHasLabelWithValue) |
There was a problem hiding this comment.
These two are really similar, yet have different verbs ("contains" vs "has"), can we ry to use the same verb?
76c749f
into
operator-framework:main
Description
Add the owner-kind label to ClusterExtensionRevision resources to ensure they are properly labeled with both owner-kind and owner-name.
Previously, only the owner-name label was set on the ClusterExtensionRevision resource itself. The owner-kind label was only applied to objects within the revision, but not to the revision resource.
This change updates the buildClusterExtensionRevision function to set both labels.OwnerKindKey (ClusterExtension) and labels.OwnerNameKey on the ClusterExtensionRevision metadata.
Also fixed variable name collision where local variable 'labels' shadowed the imported 'labels' package by renaming it to 'mergedLabels' and moved the merging of label maps to an utility function
Co-Authored by Claude
Reviewer Checklist