Skip to content

Conversation

@rsoaresd
Copy link
Contributor

@rsoaresd rsoaresd commented Oct 31, 2025

Description

We need a new label for the nstemplateset resource that indicates which cluster owns it. This need is due to the flakiness we are facing when retagetting the same space. For more info, please check codeready-toolchain/member-operator#707

Checks

  1. Did you run make generate target? yes

  2. Did make generate change anything in other projects (host-operator, member-operator)? no

  3. In case of new CRD, did you the following? N/A

  4. In case other projects are changed, please provides PR links. N/A

Related PR

codeready-toolchain/member-operator#707

Issue ticket number and link

SANDBOX-1472

Summary by CodeRabbit

  • Chores
    • Internal infrastructure improvements for cluster labeling support.

@coderabbitai
Copy link

coderabbitai bot commented Oct 31, 2025

Walkthrough

A new exported constant ClusterOwnerLabelKey is added to the NSTemplateSet package, defined as a concatenation of LabelKeyPrefix and the string "cluster-owner". No behavioral changes or existing logic modifications.

Changes

Cohort / File(s) Change Summary
Label constant addition
api/v1alpha1/nstemplateset_types.go
Added new exported constant ClusterOwnerLabelKey with value LabelKeyPrefix + "cluster-owner" for identifying cluster owner labels

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Straightforward constant definition with no logic or dependencies to validate

Poem

🐰 A label springs forth, simple and true,
For cluster owners, shiny and new!
One constant blooms in the garden of code,
A keystone laid gently upon the road. ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "add cluster owner label for the nstemplateset resource" is directly and accurately related to the main change in the changeset. The raw summary confirms that a new exported constant ClusterOwnerLabelKey was added for the NSTemplateSet resource, which is precisely what the title describes. The title is concise, uses clear and specific language, and would help teammates quickly understand the purpose of this change when scanning the repository history.
Description Check ✅ Passed The PR description follows the repository's template structure and includes all required sections. The description clearly states the purpose of the change (adding a label to indicate cluster ownership), provides context about why it's needed (addressing flakiness when retargetting spaces), and answers all four checklist questions appropriately. Additionally, the author provides helpful references to a related PR and issue ticket, which enhances the description beyond the basic template requirements.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06282b8 and f990a90.

📒 Files selected for processing (1)
  • api/v1alpha1/nstemplateset_types.go (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
api/v1alpha1/nstemplateset_types.go (1)
api/v1alpha1/labels.go (1)
  • LabelKeyPrefix (5-5)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Verify Dependencies
🔇 Additional comments (1)
api/v1alpha1/nstemplateset_types.go (1)

15-15: Constant defined but usage not found in this repository.

The search confirms ClusterOwnerLabelKey is only present at its definition (line 15) and not used anywhere in the current codebase. This is expected for API constant exports. However, verification in the consuming project (member-operator#707) cannot be completed from this sandbox environment.

The constant definition is correctly implemented and follows the established pattern. Manual verification is needed to confirm it's actively used in the related PR to avoid dead code.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

TierLabelKey = LabelKeyPrefix + "tier"
ProviderLabelKey = LabelKeyPrefix + "provider"
ProviderLabelValue = "codeready-toolchain"
ClusterOwnerLabelKey = LabelKeyPrefix + "cluster-owner"
Copy link
Contributor

Choose a reason for hiding this comment

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

This label is needed only in the member operator for distinguishing between 2 member operators running in a single cluster. As far as I understood the problem, this label isn't really needed if the members are in different clusters.

So "cluster-owner" seems a bit confusing to me. What about something like "managing-member"?

@rsoaresd
Copy link
Contributor Author

rsoaresd commented Nov 3, 2025

Closing since we will follow other approach

@rsoaresd rsoaresd closed this Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants