Skip to content

OCPBUGS-79539: fix(cpo-v2): preserve HCCO modifications to OCM Controllers field#8072

Merged
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
sjenning:fix-ir-disable
Apr 2, 2026
Merged

OCPBUGS-79539: fix(cpo-v2): preserve HCCO modifications to OCM Controllers field#8072
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
sjenning:fix-ir-disable

Conversation

@sjenning
Copy link
Copy Markdown
Contributor

@sjenning sjenning commented Mar 25, 2026

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 was noted in CPOv1 reconcileConfig() for OCM at one point but the comment was lost here
https://github.com/openshift/hypershift/pull/5456/changes#diff-35cfcb87bebf36a8326be8962fb764438dbba55332d0776dae54d94dbfd614d2L60

🔴 #7634 removed the HCCO but we still need it as it is in-use by users. The PR reverts this change.


Note

Medium Risk
Touches control-plane reconciliation of the image registry and openshift-controller-manager config, so mis-merges could unexpectedly enable/disable controllers or change registry behavior, but the change is small and covered by targeted unit tests.

Overview
Ensures control-plane-operator preserves in-cluster modifications to the openshift-controller-manager config by reading the existing ConfigMap from the cluster and reusing its Controllers field when the Image Registry capability is not explicitly disabled.

In the hosted cluster config operator reconciliation loop, inlines image-registry config reconciliation and adds a temporary path: when imageregistry is set to managementState: Removed (on non-IBMCloud/non-Azure), it updates the control-plane openshift-controller-manager config to disable the pull-secrets controller.

Updates/extends unit tests to validate controller preservation vs explicit Image Registry capability disable, and removes the now-obsolete reconcileImageRegistry unit test.

Written by Cursor Bugbot for commit 46d5bff. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced registry configuration validation with improved error detection and handling
  • Refactor

    • Streamlined image registry reconciliation into the main control flow
    • Optimized platform-specific bootstrap logic for registry initialization
  • Tests

    • Removed outdated test coverage for image registry reconciliation

@openshift-ci-robot
Copy link
Copy Markdown

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Mar 25, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@sjenning: This pull request references Jira Issue OCPBUGS-79539, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

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

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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 25, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 855d17ad-6e36-48a7-88cc-fc5b6451ef5e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The pull request refactors image registry reconciliation in the control-plane operator by inlining the reconcileImageRegistry helper directly into the Reconcile method. The change introduces an upfront existence check for the registry configuration object, altering error handling to immediately return non-NotFound errors. Bootstrap gating for platform-specific scenarios is updated to skip registry reconciliation when the config is missing and the platform requires PVC. Registry validation policies are now reconciled only on Azure, while controller-manager configuration is updated when the registry state transitions to Removed on non-IBM/Azure platforms. A corresponding test suite is removed, and a configuration option is added to the OCM component's manifest adapter.

Sequence Diagram

Sequence diagram generation is not applicable for these changes as they primarily consist of refactoring and configuration adjustments without introducing significant new feature interactions that would benefit from visualization.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci Bot added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release and removed do-not-merge/needs-area labels Mar 25, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@sjenning: This pull request references Jira Issue OCPBUGS-79539, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

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

[!NOTE]
Medium Risk
Changes reconciliation to read and reuse in-cluster OpenShiftControllerManagerConfig.Controllers, which can alter controller-manager behavior if the fetched config is unexpected or stale. Scope is limited and covered by new unit tests for both preserve vs override paths.

Overview
Stops CPO v2 from clobbering HCCO changes to the OpenShift Controller Manager Controllers list during reconciliation.

adaptConfigMap now fetches the live OCM ConfigMap from the cluster and passes the existing Controllers into adaptConfig, which preserves them when the Image Registry capability is enabled, and only forces the pull-secrets controller disablement when the capability is explicitly disabled. Adds targeted tests covering both the preserve and override behaviors.

Written by Cursor Bugbot for commit b09a3ce. This will update automatically on new commits. Configure here.

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.

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 25, 2026
@openshift-ci openshift-ci Bot requested review from devguyio and jparrill March 25, 2026 19:17
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
control-plane-operator/controllers/hostedcontrolplane/v2/ocm/config_test.go (1)

175-177: Strengthen precedence assertion in disabled-capability test

Line 176 passes nil for existingControllers, so this test doesn’t prove that disabled capability overrides a conflicting existing value. Pass a non-empty conflicting slice and keep the same expected result to lock precedence behavior.

Test hardening diff
-	adaptConfig(config, hcp.Spec.Configuration, imageProvider, &v1.Build{}, hcp.Spec.Capabilities, []string{}, nil)
+	adaptConfig(
+		config,
+		hcp.Spec.Configuration,
+		imageProvider,
+		&v1.Build{},
+		hcp.Spec.Capabilities,
+		[]string{},
+		[]string{"*"}, // conflicting existing value; disabled capability should still force pull-secret controller off
+	)

Also applies to: 179-184

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@control-plane-operator/controllers/hostedcontrolplane/v2/ocm/config_test.go`
around lines 175 - 177, The test currently calls adaptConfig(config,
hcp.Spec.Configuration, imageProvider, &v1.Build{}, hcp.Spec.Capabilities,
[]string{}, nil) passing nil for existingControllers so it doesn't verify that a
disabled capability beats a conflicting existing controller; update the call(s)
to pass a non-empty slice containing a conflicting controller name (e.g.,
[]string{"image-registry"}) instead of nil and keep the same expected assertions
so the test verifies that adaptConfig still disables the controller when the
ImageRegistry capability is explicitly disabled; apply the same change to the
other occurrences around lines 179-184 that call adaptConfig with nil
existingControllers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@control-plane-operator/controllers/hostedcontrolplane/v2/ocm/config.go`:
- Around line 42-50: The current code silently ignores errors from
cpContext.Client.Get and util.DeserializeResource which can cause accidental
overwrite of controller settings; update the logic in the block that reads
existingCM/configKey to explicitly handle failures: if cpContext.Client.Get(...)
returns an error, propagate/return that error (or requeue) instead of treating
it as a no-op, and if util.DeserializeResource(...) fails, log and return the
deserialize error (or requeue) instead of continuing; make these checks around
cpContext.Client.Get, existingCM, util.DeserializeResource, existingConfig and
only set existingControllers when deserialization succeeds.

---

Nitpick comments:
In `@control-plane-operator/controllers/hostedcontrolplane/v2/ocm/config_test.go`:
- Around line 175-177: The test currently calls adaptConfig(config,
hcp.Spec.Configuration, imageProvider, &v1.Build{}, hcp.Spec.Capabilities,
[]string{}, nil) passing nil for existingControllers so it doesn't verify that a
disabled capability beats a conflicting existing controller; update the call(s)
to pass a non-empty slice containing a conflicting controller name (e.g.,
[]string{"image-registry"}) instead of nil and keep the same expected assertions
so the test verifies that adaptConfig still disables the controller when the
ImageRegistry capability is explicitly disabled; apply the same change to the
other occurrences around lines 179-184 that call adaptConfig with nil
existingControllers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 5ab04ec1-510f-4bf1-866c-2adfb215fe93

📥 Commits

Reviewing files that changed from the base of the PR and between 77fb5d8 and b09a3ce.

📒 Files selected for processing (2)
  • control-plane-operator/controllers/hostedcontrolplane/v2/ocm/config.go
  • control-plane-operator/controllers/hostedcontrolplane/v2/ocm/config_test.go

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go (1)

454-462: Consider simplifying the error handling.

The closure can be simplified since the error is just returned directly.

♻️ Simplified closure
 		if _, err := r.CreateOrUpdate(ctx, r.client, registryConfig, func() error {
-			err = registry.ReconcileRegistryConfig(registryConfig, r.platformType, hcp.Spec.InfrastructureAvailabilityPolicy)
-			if err != nil {
-				return err
-			}
-			return nil
+			return registry.ReconcileRegistryConfig(registryConfig, r.platformType, hcp.Spec.InfrastructureAvailabilityPolicy)
 		}); err != nil {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go`
around lines 454 - 462, The closure passed to r.CreateOrUpdate is verbose
because it assigns err then checks and returns it; simplify by returning the
result of registry.ReconcileRegistryConfig directly. Update the anonymous
function passed to r.CreateOrUpdate so it simply calls and returns
registry.ReconcileRegistryConfig(registryConfig, r.platformType,
hcp.Spec.InfrastructureAvailabilityPolicy) instead of setting err and
conditionally returning it, keeping the surrounding CreateOrUpdate call and
error wrap logic unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go`:
- Around line 454-462: The closure passed to r.CreateOrUpdate is verbose because
it assigns err then checks and returns it; simplify by returning the result of
registry.ReconcileRegistryConfig directly. Update the anonymous function passed
to r.CreateOrUpdate so it simply calls and returns
registry.ReconcileRegistryConfig(registryConfig, r.platformType,
hcp.Spec.InfrastructureAvailabilityPolicy) instead of setting err and
conditionally returning it, keeping the surrounding CreateOrUpdate call and
error wrap logic unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: b509cb8f-6d67-4ec6-9494-c9e139affa9b

📥 Commits

Reviewing files that changed from the base of the PR and between b09a3ce and 8aff732.

📒 Files selected for processing (4)
  • control-plane-operator/controllers/hostedcontrolplane/v2/ocm/config.go
  • control-plane-operator/controllers/hostedcontrolplane/v2/ocm/config_test.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go
💤 Files with no reviewable changes (1)
  • control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • control-plane-operator/controllers/hostedcontrolplane/v2/ocm/config.go
  • control-plane-operator/controllers/hostedcontrolplane/v2/ocm/config_test.go

}
} else {
registryConfigExists = true
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Registry config fetch moved outside capability guard

Medium Severity

The r.client.Get call for the registry config was moved outside the IsImageRegistryCapabilityEnabled check. Previously, reconcileImageRegistry was only called when the capability was enabled, so the Get never executed when the capability was disabled. Now it runs unconditionally. If the ImageRegistry capability is disabled and the imageregistry.operator.openshift.io/v1 CRD is absent from the guest cluster, the Get returns a non-NotFound error, triggering a hard return ctrl.Result{}, err that aborts the entire reconciliation — blocking all subsequent steps like ingress, additional trusted CAs, etc. The registryConfig and registryConfigExists variables are only consumed inside the capability-enabled block, so the fetch can be moved back inside that guard.

Fix in Cursor Fix in Web

@sjenning sjenning force-pushed the fix-ir-disable branch 2 times, most recently from e6828dd to 16c28d4 Compare March 27, 2026 14:12
}

// TODO: remove this when ROSA HCP stops setting the managementState to Removed to disable the Image Registry
if registryConfig.Spec.ManagementState == operatorv1.Removed && r.platformType != hyperv1.IBMCloudPlatform && r.platformType != hyperv1.AzurePlatform {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add unit tests for managementState == Removed OCM ConfigMap logic

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changes to resources.go and resources_test.go are just the revert

@@ -2964,127 +2963,3 @@ func Test_reconciler_reconcileKASConnectionCheckerDeployment(t *testing.T) {
})
}
}

func TestReconcileImageRegistry(t *testing.T) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we restore or replace deleted TestReconcileImageRegistry test coverage (4 platform-specific scenarios lost)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The revert was not clean unfortunately. Are you saying that something not related to the revert was removed?

// (e.g., Controllers field when registry is disabled via managementState: Removed)
var existingControllers []string
existingCM := &corev1.ConfigMap{}
err = cpContext.Client.Get(cpContext.Context, client.ObjectKeyFromObject(cm), existingCM)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this use component.ReconcileExisting() to leverage cpov2 framework?

Copy link
Copy Markdown
Contributor

@muraee muraee Mar 27, 2026

Choose a reason for hiding this comment

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

I'd rather we don't and keep it explicit to the controllers field

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TIL ☝️

if !capabilities.IsImageRegistryCapabilityEnabled(caps) {
cfg.Controllers = []string{"*", fmt.Sprintf("-%s", openshiftcpv1.OpenShiftServiceAccountPullSecretsController)}
cfg.DockerPullSecret.InternalRegistryHostname = ""
} else if len(existingControllers) > 0 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The same cursor stale controller comment was picked up by the HyperShift SME agents as well. Is this not an issue?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is not, we don't allow re-enabling of the image registry via this mechanism

}

// TODO: remove this when ROSA HCP stops setting the managementState to Removed to disable the Image Registry
if registryConfig.Spec.ManagementState == operatorv1.Removed && r.platformType != hyperv1.IBMCloudPlatform && r.platformType != hyperv1.AzurePlatform {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we add a comment why IBM and Azure are being excluded from the managementState check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Honestly, this should have been "only AWS" not "not IBM and not Azure". It is part of the revert as well though.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

WithManifestAdapter(
"config.yaml",
component.WithAdaptFunction(adaptConfigMap),
component.ReconcileExisting(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we shouldn't be doing this. The static configMap manifest has some fields already that are loaded and used https://github.com/openshift/hypershift/blob/main/control-plane-operator/controllers/hostedcontrolplane/v2/assets/openshift-controller-manager/config.yaml

if we do this, any changes to manifest in the future will not apply to existing clusters

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I restored it to the older way within this PR doing a Get and only merging the controllers

@sjenning
Copy link
Copy Markdown
Contributor Author

sjenning commented Apr 1, 2026

Reviewer note: any changes under control-plane-operator/hostedclusterconfigoperator are part of a straight revert (outside the *_test.go conflicts)

@sjenning
Copy link
Copy Markdown
Contributor Author

sjenning commented Apr 1, 2026

/test security

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>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 22.85714% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.94%. Comparing base (c54e7af) to head (46d5bff).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...rconfigoperator/controllers/resources/resources.go 16.98% 38 Missing and 6 partials ⚠️
...or/controllers/hostedcontrolplane/v2/ocm/config.go 41.17% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8072      +/-   ##
==========================================
- Coverage   29.96%   29.94%   -0.02%     
==========================================
  Files        1049     1049              
  Lines       97523    97557      +34     
==========================================
- Hits        29225    29216       -9     
- Misses      65796    65837      +41     
- Partials     2502     2504       +2     
Files with missing lines Coverage Δ
...or/controllers/hostedcontrolplane/v2/ocm/config.go 42.70% <41.17%> (-0.51%) ⬇️
...rconfigoperator/controllers/resources/resources.go 51.79% <16.98%> (-0.91%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@bryan-cox bryan-cox left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 1, 2026
@openshift-ci-robot
Copy link
Copy Markdown

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-azure-self-managed
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 1, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox, sjenning

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

@sjenning
Copy link
Copy Markdown
Contributor Author

sjenning commented Apr 1, 2026

code coverage reduction is due to the revert

/override codecov/patch
/override odecov/project

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 1, 2026

@sjenning: /override requires failed status contexts, check run or a prowjob name to operate on.
The following unknown contexts/checkruns were given:

  • odecov/project

Only the following failed contexts/checkruns were expected:

  • CodeRabbit
  • ci/prow/e2e-aks
  • ci/prow/e2e-aws
  • ci/prow/e2e-aws-upgrade-hypershift-operator
  • ci/prow/e2e-azure-self-managed
  • ci/prow/e2e-kubevirt-aws-ovn-reduced
  • ci/prow/e2e-v2-aws
  • ci/prow/images
  • ci/prow/okd-scos-images
  • ci/prow/security
  • ci/prow/verify-deps
  • codecov/patch
  • codecov/project
  • pull-ci-openshift-hypershift-main-e2e-aks
  • pull-ci-openshift-hypershift-main-e2e-aws
  • pull-ci-openshift-hypershift-main-e2e-aws-upgrade-hypershift-operator
  • pull-ci-openshift-hypershift-main-e2e-azure-self-managed
  • pull-ci-openshift-hypershift-main-e2e-kubevirt-aws-ovn-reduced
  • pull-ci-openshift-hypershift-main-e2e-v2-aws
  • pull-ci-openshift-hypershift-main-images
  • pull-ci-openshift-hypershift-main-okd-scos-images
  • pull-ci-openshift-hypershift-main-security
  • pull-ci-openshift-hypershift-main-verify-deps
  • tide

If you are trying to override a checkrun that has a space in it, you must put a double quote on the context.

Details

In response to this:

code coverage reduction is due to the revert

/override codecov/patch
/override odecov/project

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.

@bryan-cox
Copy link
Copy Markdown
Member

/override codecov/project

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 1, 2026

@bryan-cox: Overrode contexts on behalf of bryan-cox: codecov/project

Details

In response to this:

/override codecov/project

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.

@bryan-cox
Copy link
Copy Markdown
Member

/test e2e-aks

@sjenning
Copy link
Copy Markdown
Contributor Author

sjenning commented Apr 2, 2026

/test e2e-azure-self-managed

@sjenning
Copy link
Copy Markdown
Contributor Author

sjenning commented Apr 2, 2026

/verified by @sjenning

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Apr 2, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@sjenning: This PR has been marked as verified by @sjenning.

Details

In response to this:

/verified by @sjenning

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
Copy link
Copy Markdown
Contributor Author

sjenning commented Apr 2, 2026

/override codecov/patch

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 2, 2026

@sjenning: Overrode contexts on behalf of sjenning: codecov/patch

Details

In response to this:

/override codecov/patch

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.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 2, 2026

@sjenning: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot Bot merged commit e087807 into openshift:main Apr 2, 2026
30 of 32 checks passed
@openshift-ci-robot
Copy link
Copy Markdown

@sjenning: Jira Issue Verification Checks: Jira Issue OCPBUGS-79539
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-79539 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

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 was noted in CPOv1 reconcileConfig() for OCM at one point but the comment was lost here
https://github.com/openshift/hypershift/pull/5456/changes#diff-35cfcb87bebf36a8326be8962fb764438dbba55332d0776dae54d94dbfd614d2L60

🔴 #7634 removed the HCCO but we still need it as it is in-use by users. The PR reverts this change.


[!NOTE]
Medium Risk
Touches control-plane reconciliation of the image registry and openshift-controller-manager config, so mis-merges could unexpectedly enable/disable controllers or change registry behavior, but the change is small and covered by targeted unit tests.

Overview
Ensures control-plane-operator preserves in-cluster modifications to the openshift-controller-manager config by reading the existing ConfigMap from the cluster and reusing its Controllers field when the Image Registry capability is not explicitly disabled.

In the hosted cluster config operator reconciliation loop, inlines image-registry config reconciliation and adds a temporary path: when imageregistry is set to managementState: Removed (on non-IBMCloud/non-Azure), it updates the control-plane openshift-controller-manager config to disable the pull-secrets controller.

Updates/extends unit tests to validate controller preservation vs explicit Image Registry capability disable, and removes the now-obsolete reconcileImageRegistry unit test.

Written by Cursor Bugbot for commit 46d5bff. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Bug Fixes

  • Enhanced registry configuration validation with improved error detection and handling

  • Refactor

  • Streamlined image registry reconciliation into the main control flow

  • Optimized platform-specific bootstrap logic for registry initialization

  • Tests

  • Removed outdated test coverage for image registry reconciliation

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.

@openshift-merge-robot
Copy link
Copy Markdown
Contributor

Fix included in accepted release 4.22.0-0.nightly-2026-04-03-204456

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. area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants