Enable auto-registration when Rancher Prime is deployed via Helm with registration code#126
Merged
Merged
Conversation
…tion code Signed-off-by: Samuel Vasconcelos <samuel.vasconcelos@suse.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes automatic SCC registration when Rancher Prime is installed via Helm with registration.enabled=true and registration.regCode by adjusting how the operator determines whether it should process the Helm-created scc-registration Secret, avoiding conflicts with Helm’s app.kubernetes.io/managed-by: Helm label.
Changes:
- Preserve (do not overwrite) the existing
app.kubernetes.io/managed-bylabel on Helm-created entrypoint Secrets while still allowing the operator to process them. - Introduce SCC-specific ownership helpers (
scc.cattle.io/managed-by) and associated unit tests. - Replace
maps.Copylabel merges in the Secret controller with explicit merge logic.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| pkg/controllers/resources.go | Updates registration param extraction/label production to preserve existing k8s managed-by. |
| pkg/controllers/helpers/ownership.go | Adds SCC-specific ownership helpers and management decision logic. |
| pkg/controllers/helpers/ownership_scc_test.go | Adds unit tests for the new SCC-specific ownership helpers. |
| pkg/controllers/controller.go | Updates Secret reconciliation to use SCC ownership rules for Helm entrypoint secrets and preserve Helm’s managed-by label during label merges. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Samuel Vasconcelos <samuel.vasconcelos@suse.com>
Signed-off-by: Samuel Vasconcelos <samuel.vasconcelos@suse.com>
Signed-off-by: Samuel Vasconcelos <samuel.vasconcelos@suse.com>
mallardduck
requested changes
Jul 8, 2026
alemorcuq
reviewed
Jul 8, 2026
Signed-off-by: Samuel Vasconcelos <samuel.vasconcelos@suse.com>
mallardduck
requested changes
Jul 8, 2026
mallardduck
left a comment
Member
There was a problem hiding this comment.
Just a few more nits - great work
alemorcuq
reviewed
Jul 8, 2026
Signed-off-by: Samuel Vasconcelos <samuel.vasconcelos@suse.com>
mallardduck
requested changes
Jul 8, 2026
Signed-off-by: Samuel Vasconcelos <samuel.vasconcelos@suse.com>
mallardduck
approved these changes
Jul 9, 2026
mallardduck
left a comment
Member
There was a problem hiding this comment.
lgtm, if @alemorcuq also approves we can merge in the AM
alemorcuq
requested changes
Jul 9, 2026
Signed-off-by: Samuel Vasconcelos <samuel.vasconcelos@suse.com>
mallardduck
requested changes
Jul 9, 2026
Signed-off-by: Samuel Vasconcelos <samuel.vasconcelos@suse.com>
mallardduck
approved these changes
Jul 9, 2026
alemorcuq
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issue: #125
Fixes automatic SCC registration when Rancher Prime is installed via Helm with
registration.enabled=trueandregistration.regCodeset.Previously, the operator would skip processing the scc-registration Secret created by Helm due to a label ownership conflict (Helm sets
app.kubernetes.io/managed-by: Helm, but the operator expectedrancher-scc-operator).