OCPBUGS-81836: OCPBUGS-81670: fix(cpo-v2): preserve HCCO modifications to OCM Controllers field#8157
Conversation
CPO v2 was overwriting the entire OCM config on each reconciliation, erasing HCCO's modification to disable the pull secrets controller when the image registry is disabled via managementState: Removed instead of the ImageRegistry capability. This fix: - Fetches the actual ConfigMap from the cluster (not just the static asset) - Preserves the existing Controllers field when ImageRegistry capability is enabled but HCCO has modified it (e.g., via managementState: Removed) - Only overrides Controllers when ImageRegistry capability is explicitly disabled This ensures that registry pull secrets are not created when the registry is disabled via managementState: Removed on non-Azure/non-IBM platforms. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/jira cherry-pick OCPBUGS-79471 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sjenning 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 |
|
@sjenning: Jira Issue OCPBUGS-79471 has been cloned as Jira Issue OCPBUGS-81670. Will retitle bug to link to clone. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@sjenning: This pull request references Jira Issue OCPBUGS-81670, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira cherry-pick OCPBUGS-79539 |
|
@sjenning: Jira Issue OCPBUGS-79539 has been cloned as Jira Issue OCPBUGS-81836. Will retitle bug to link to clone. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@sjenning: This pull request references Jira Issue OCPBUGS-81836, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@sjenning: This pull request references Jira Issue OCPBUGS-81836, which is valid. The bug has been moved to the POST state. 7 validation(s) were run on this bug
DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/verified later by @sjenning |
|
@sjenning: Only users can be targets for the DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/verified later @sjenning |
|
@sjenning: This PR has been marked to be verified later by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/test e2e-aws-external-oidc |
Pre-Merge Analysis: OCPBUGS-81836 — Preserve HCCO modifications to OCM Controllers fieldFeature SummaryThis PR is a manual backport of #8072 (merged and VERIFIED on Test Coverage Issues
Fix FeasibilityMatch assessment: EXACT_MATCH — the fix correctly intercepts the CPO v2 reconciliation path that was erasing HCCO's Controllers field.
Backport correctness: The fix is a correct minimal backport. On Recommendations
Analysis generated via |
|
/lgtm |
…BUGS-81836) Adds a CI verification job for release-4.21 that tests CPO v2 preservation of HCCO modifications to the OCM ConfigMap Controllers field when Image Registry managementState is set to Removed. Uses a custom CPO image (quay.io/zhfeng/hypershift:cpo-ocpbugs-81836) built from PR openshift/hypershift#8157 to verify the fix at runtime. The job creates a HostedCluster with the fixed CPO, disables the image registry, verifies that the OCM Controllers field is preserved across CPO v2 reconciliation cycles, and confirms no pull secrets are created for new ServiceAccounts.
|
@sjenning: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
a4bc7b0
into
openshift:release-4.21
|
@sjenning: Jira Issue OCPBUGS-81836: All pull requests linked via external trackers have merged: This pull request has the DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/cherry-pick release-4.20 |
|
@sjenning: new pull request created: #8177 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Manual backport of #8072 without the revert for #7634 since it was not backported to 4.21
CPO v2 was overwriting the entire OCM config on each reconciliation, erasing HCCO's modification to disable the pull secrets controller when the image registry is disabled via managementState: Removed instead of the ImageRegistry capability.
This fix:
This ensures that registry pull secrets are not created when the registry is disabled via managementState: Removed on non-Azure/non-IBM platforms.
Note
Medium Risk
Touches control-plane reconciliation logic for the OpenShift Controller Manager ConfigMap; an incorrect merge/preserve decision could unintentionally enable/disable controllers (notably pull-secrets) across upgrades or reconciles.
Overview
Prevents CPO v2 from overwriting HCCO changes to the OpenShift Controller Manager config by fetching the existing in-cluster
ConfigMapand reusing itsControllersvalue when present.The reconciler now only forces
Controllersto disable the pull-secrets controller when theImageRegistrycapability is explicitly disabled; otherwise it preserves the existing cluster-setControllers. Tests were updated and expanded to cover both preservation and explicit-disable behavior.Written by Cursor Bugbot for commit 0e19951. This will update automatically on new commits. Configure here.