Skip to content

🐛 Set owner-kind label on ClusterExtensionRevision resources#2480

Merged
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
perdasilva:add-owner-kind-label
Feb 3, 2026
Merged

🐛 Set owner-kind label on ClusterExtensionRevision resources#2480
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
perdasilva:add-owner-kind-label

Conversation

@perdasilva
Copy link
Contributor

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

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

Copilot AI review requested due to automatic review settings February 3, 2026 14:10
@netlify
Copy link

netlify bot commented Feb 3, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 9f70e10
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/69824b585964c10008da14ab
😎 Deploy Preview https://deploy-preview-2480--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.

Copy link
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

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 the buildClusterExtensionRevision function
  • Refactored duplicate label merging logic into a new mergeLabelMaps utility 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
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.74%. Comparing base (2582cf1) to head (9f70e10).
⚠️ Report is 1 commits behind head on main.

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     
Flag Coverage Δ
e2e 46.01% <0.00%> (-0.24%) ⬇️
experimental-e2e 13.03% <0.00%> (+0.05%) ⬆️
unit 57.81% <100.00%> (+0.01%) ⬆️

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.

@perdasilva perdasilva force-pushed the add-owner-kind-label branch from 525f70c to 3a0c9f6 Compare February 3, 2026 15:41
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 3, 2026
@openshift-ci
Copy link

openshift-ci bot commented Feb 3, 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 Feb 3, 2026
@perdasilva perdasilva force-pushed the add-owner-kind-label branch from 3a0c9f6 to 13b560d Compare February 3, 2026 19:23
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 3, 2026
@openshift-ci
Copy link

openshift-ci bot commented Feb 3, 2026

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>
@perdasilva perdasilva force-pushed the add-owner-kind-label branch from 13b560d to 9f70e10 Compare February 3, 2026 19:24
Comment on lines 76 to +77
sc.Step(`^(?i)ClusterExtensionRevision "([^"]+)" contains annotation "([^"]+)" with value$`, ClusterExtensionRevisionHasAnnotationWithValue)
sc.Step(`^(?i)ClusterExtensionRevision "([^"]+)" has label "([^"]+)" with value "([^"]+)"$`, ClusterExtensionRevisionHasLabelWithValue)
Copy link
Contributor

Choose a reason for hiding this comment

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

These two are really similar, yet have different verbs ("contains" vs "has"), can we ry to use the same verb?

@perdasilva perdasilva added the lgtm Indicates that a PR is ready to be merged. label Feb 3, 2026
@openshift-merge-bot openshift-merge-bot bot merged commit 76c749f into operator-framework:main Feb 3, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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