Skip to content

Bug 105607: [release-4.19] CPO does not propagate --registry-overrides to init containers it injects in HCP sub-resources - #9278

Closed
avollmer-redhat wants to merge 1 commit into
openshift:release-4.19from
avollmer-redhat:fix/OCPBUGS-105607-combined-backport-4.19
Closed

Bug 105607: [release-4.19] CPO does not propagate --registry-overrides to init containers it injects in HCP sub-resources#9278
avollmer-redhat wants to merge 1 commit into
openshift:release-4.19from
avollmer-redhat:fix/OCPBUGS-105607-combined-backport-4.19

Conversation

@avollmer-redhat

Copy link
Copy Markdown

Bug

https://issues.redhat.com/browse/OCPBUGS-105607

What

Backports #8509 and #8824 to release-4.19.

This is the same combined backport already merged to release-4.22, release-4.21, and open on release-4.20.

Why

The Control Plane Operator (CPO) uses strings.Replace for registry overrides, which:

  1. Does not propagate overrides to init containers (availability-prober) it injects into HCP sub-resources
  2. Uses naive substring matching that can produce false matches (e.g. quay.io matching quay.io.example.com)
  3. Does not correctly handle digest (@sha256:) vs tag (:) separators

Without this fix, ValidatingAdmissionPolicies in Deny mode block HCP creation in environments that restrict image sources to MCR/ACR, because CPO-managed init containers retain their original quay.io registry references.

Changes

  1. Add support/util/registryoverride package with strict longest-prefix matching
  2. Fix RegistryMirrorProviderDecorator.Lookup to use registryoverride.Replace
  3. Add imageprovider.NewWithRegistryOverrides for provider-level override application
  4. Wire NewWithRegistryOverrides into HCP controller reconcile loop

Tracking

Version Bug PR Status
5.0 (main) OCPBUGS-85585 #8509, #8824 Merged
4.22 OCPBUGS-94170 #8877 Merged
4.21 OCPBUGS-94179 #8879 Merged
4.20 OCPBUGS-94180 #8880 Open
4.19 OCPBUGS-105607 This PR New

/label backport-risk-assessed
/jira OCPBUGS-105607

…t containers

Backports openshift#8509 and openshift#8824 to release-4.19:

1. Add support/util/registryoverride package with strict longest-prefix
   matching that correctly handles digest (@sha256:) and tag (:) separators,
   preventing false substring matches (e.g. "quay.io" matching
   "quay.io.example.com").

2. Fix RegistryMirrorProviderDecorator.Lookup to use registryoverride.Replace
   instead of strings.Replace, eliminating the original substring-match bug.

3. Add imageprovider.NewWithRegistryOverrides to apply registry overrides to
   all component images at provider creation time, ensuring init containers
   (availability-prober) and other CPO sub-resources use overridden images.

4. Wire NewWithRegistryOverrides into the HCP controller reconcile loop so
   the control-plane release image provider applies overrides.

Without this fix, CPO-managed init containers (e.g. availability-prober)
retain original registry references, causing ValidatingAdmissionPolicies in
Deny mode to block HCP creation in environments that restrict image sources.
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8299dd95-a534-4437-8055-9a82d5fd5ba7

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

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.

@openshift-ci
openshift-ci Bot requested review from rtheis and sjenning August 11, 2026 14:13
@openshift-ci openshift-ci Bot added the area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release label Aug 11, 2026
@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: avollmer-redhat
Once this PR has been reviewed and has the lgtm label, please assign csrwng for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@avollmer-redhat: The label(s) backport-risk-assessed cannot be applied or removed, because you are not in one of the allowed teams and are not an allowed user. Must be a member of one of these teams: openshift-patch-managers, openshift-staff-engineers, openshift-release-oversight, openshift-sustaining-engineers

Details

In response to this:

Bug

https://issues.redhat.com/browse/OCPBUGS-105607

What

Backports #8509 and #8824 to release-4.19.

This is the same combined backport already merged to release-4.22, release-4.21, and open on release-4.20.

Why

The Control Plane Operator (CPO) uses strings.Replace for registry overrides, which:

  1. Does not propagate overrides to init containers (availability-prober) it injects into HCP sub-resources
  2. Uses naive substring matching that can produce false matches (e.g. quay.io matching quay.io.example.com)
  3. Does not correctly handle digest (@sha256:) vs tag (:) separators

Without this fix, ValidatingAdmissionPolicies in Deny mode block HCP creation in environments that restrict image sources to MCR/ACR, because CPO-managed init containers retain their original quay.io registry references.

Changes

  1. Add support/util/registryoverride package with strict longest-prefix matching
  2. Fix RegistryMirrorProviderDecorator.Lookup to use registryoverride.Replace
  3. Add imageprovider.NewWithRegistryOverrides for provider-level override application
  4. Wire NewWithRegistryOverrides into HCP controller reconcile loop

Tracking

Version Bug PR Status
5.0 (main) OCPBUGS-85585 #8509, #8824 Merged
4.22 OCPBUGS-94170 #8877 Merged
4.21 OCPBUGS-94179 #8879 Merged
4.20 OCPBUGS-94180 #8880 Open
4.19 OCPBUGS-105607 This PR New

/label backport-risk-assessed
/jira OCPBUGS-105607

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 openshift-ci Bot added area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release and removed do-not-merge/needs-area labels Aug 11, 2026
@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@avollmer-redhat: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-kubevirt-aws-ovn-reduced cb11048 link true /test e2e-kubevirt-aws-ovn-reduced
ci/prow/e2e-aks cb11048 link true /test e2e-aks

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.

@rtheis

rtheis commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

/uncc @rtheis

@openshift-ci
openshift-ci Bot removed the request for review from rtheis August 11, 2026 18:41
@avollmer-redhat

Copy link
Copy Markdown
Author

Closing — OCPBUGS-105607 has been closed as Won't Do. A cluster audit across all environments (INT, Stage, and all Prod geos) confirmed zero customer clusters are running OCP 4.19, only internal test/CI clusters. The 4.19 backport is no longer necessary.

/close

@openshift-ci openshift-ci Bot closed this Aug 13, 2026
@openshift-ci

openshift-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@avollmer-redhat: Closed this PR.

Details

In response to this:

Closing — OCPBUGS-105607 has been closed as Won't Do. A cluster audit across all environments (INT, Stage, and all Prod geos) confirmed zero customer clusters are running OCP 4.19, only internal test/CI clusters. The 4.19 backport is no longer necessary.

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants