Skip to content

[release-4.21] OCPBUGS-94179: fix registry override matching and propagation to init containers - #8879

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:release-4.21from
avollmer-redhat:fix/OCPBUGS-94179-combined-backport-4.21
Aug 6, 2026
Merged

[release-4.21] OCPBUGS-94179: fix registry override matching and propagation to init containers#8879
openshift-merge-bot[bot] merged 1 commit into
openshift:release-4.21from
avollmer-redhat:fix/OCPBUGS-94179-combined-backport-4.21

Conversation

@avollmer-redhat

@avollmer-redhat avollmer-redhat commented Jun 30, 2026

Copy link
Copy Markdown

Summary

Combined manual backport of #8509 and #8824 to release-4.21.

The cherry-pick bot could not create this backport automatically because the support/util/registryoverride/ package does not exist on release-4.21 (it was introduced on main by #8509), causing merge conflicts.

What this fixes

  1. Registry override substring matching bug (OCPBUGS-85585: tighten registry override matching to strict longest-prefix across release-image consumers #8509): RegistryMirrorProviderDecorator.Lookup() used strings.Replace which could match substrings inside hostnames (e.g. quay.io inside quay.io.example.com). Replaced with strict longest-prefix matching via new registryoverride.Replace() helper.

  2. Digest/tag separator handling (OCPBUGS-92034: fix registry override matching for digest and tag separators #8824): The strict matching from OCPBUGS-85585: tighten registry override matching to strict longest-prefix across release-image consumers #8509 only accepted / as a valid separator. Repository-level overrides failed to match digest-based references (repo@sha256:...). Fixed matchesPrefix() to also accept @ (digest) and : (tag, when source contains a path component).

  3. Init container image override propagation (OCPBUGS-85585: tighten registry override matching to strict longest-prefix across release-image consumers #8509): CPO-managed init containers (e.g. availability-prober) were not getting registry overrides applied because imageprovider.New() populated component images without running them through override logic. Added NewWithRegistryOverrides() and wired it into the HCP controller.

Root cause

Without these fixes, ValidatingAdmissionPolicies in Deny mode block HCP creation because CPO init containers still reference original registries (e.g. quay.io/redhat-user-workloads/...) instead of the configured mirror/ACR.

Changes

  • New: support/util/registryoverride/ package with Replace() and comprehensive tests (18 test cases)
  • Modified: support/releaseinfo/registry_mirror_provider.go — use registryoverride.Replace() instead of strings.Replace
  • Modified: control-plane-operator/.../imageprovider/imageprovider.go — add NewWithRegistryOverrides()
  • Modified: control-plane-operator/.../hostedcontrolplane_controller.go — wire NewWithRegistryOverrides with registry overrides from the release provider

Test plan

  • 18 unit tests for registryoverride.Replace covering boundary matching, longest-prefix, digest/tag separators, false-positive rejection, mutation safety
  • All existing releaseinfo tests pass
  • All existing imageprovider tests pass (compilation verified)

Related

/cc @muraee @sjenning @raelga

@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

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

Copy link
Copy Markdown

@avollmer-redhat: This pull request references Jira Issue OCPBUGS-94179, which is invalid:

  • expected Jira Issue OCPBUGS-94179 to depend on a bug targeting a version in 4.22.0 and in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but no dependents were found

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

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

Details

In response to this:

Summary\nCombined manual backport of #8509 and #8824 to release-4.21.\n\nThe cherry-pick bot could not create this backport automatically because the support/util/registryoverride/ package does not exist on release-4.21 (it was introduced on main by #8509), causing merge conflicts.\n\n## What this fixes\n\n1. Registry override substring matching bug (#8509): RegistryMirrorProviderDecorator.Lookup() used strings.Replace which could match substrings inside hostnames (e.g. quay.io inside quay.io.example.com). Replaced with strict longest-prefix matching via new registryoverride.Replace() helper.\n\n2. Digest/tag separator handling (#8824): The strict matching from #8509 only accepted / as a valid separator. Repository-level overrides failed to match digest-based references (repo@sha256:...). Fixed matchesPrefix() to also accept @ (digest) and : (tag, when source contains a path component).\n\n3. Init container image override propagation (#8509): CPO-managed init containers (e.g. availability-prober) were not getting registry overrides applied because imageprovider.New() populated component images without running them through override logic. Added NewWithRegistryOverrides() and wired it into the HCP controller.\n\n## Root cause\nWithout these fixes, ValidatingAdmissionPolicies in Deny mode block HCP creation because CPO init containers still reference original registries (e.g. quay.io/redhat-user-workloads/...) instead of the configured mirror/ACR.\n\n## Changes\n- New: support/util/registryoverride/ package with Replace() and comprehensive tests (18 test cases)\n- Modified: support/releaseinfo/registry_mirror_provider.go — use registryoverride.Replace() instead of strings.Replace\n- Modified: control-plane-operator/.../imageprovider/imageprovider.go — add NewWithRegistryOverrides()\n- Modified: control-plane-operator/.../hostedcontrolplane_controller.go — wire NewWithRegistryOverrides with registry overrides from the release provider\n\n## Test plan\n- [x] 18 unit tests for registryoverride.Replace covering boundary matching, longest-prefix, digest/tag separators, false-positive rejection, mutation safety\n- [x] All existing releaseinfo tests pass\n- [x] All existing imageprovider tests pass (compilation verified)\n\n## Related\n- Upstream PRs: #8509, #8824\n- 4.22 backport: #8877\n- Jira: OCPBUGS-94179, OCPBUGS-85585\n\n/cc @muraee @sjenning @raelga

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

coderabbitai Bot commented Jun 30, 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: Enterprise

Run ID: 549df5ee-777b-4936-903f-e63534b93e5f

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@avollmer-redhat

Copy link
Copy Markdown
Author

/label backport-risk-assessed

@openshift-ci

openshift-ci Bot commented Jun 30, 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:

/label backport-risk-assessed

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 requested review from devguyio and sjenning June 30, 2026 16:38
@openshift-ci openshift-ci Bot added 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 and removed do-not-merge/needs-area labels Jun 30, 2026
@avollmer-redhat

Copy link
Copy Markdown
Author

/area control-plane-operator
/area hypershift-operator

@avollmer-redhat

Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

@avollmer-redhat: This pull request references Jira Issue OCPBUGS-94179, which is invalid:

  • expected dependent Jira Issue OCPBUGS-94180 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is New instead
  • expected dependent Jira Issue OCPBUGS-94180 to target a version in 4.22.0, but it targets "4.20.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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.

@avollmer-redhat
avollmer-redhat force-pushed the fix/OCPBUGS-94179-combined-backport-4.21 branch from a8c2207 to 34efa85 Compare June 30, 2026 21:58
@avollmer-redhat

Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

@avollmer-redhat: This pull request references Jira Issue OCPBUGS-94179, which is invalid:

  • expected dependent Jira Issue OCPBUGS-94180 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is POST instead
  • expected dependent Jira Issue OCPBUGS-94180 to target a version in 4.22.0, but it targets "4.20.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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.

@avollmer-redhat
avollmer-redhat force-pushed the fix/OCPBUGS-94179-combined-backport-4.21 branch from 34efa85 to 697d0b5 Compare July 1, 2026 15:23
@avollmer-redhat

Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

@avollmer-redhat: This pull request references Jira Issue OCPBUGS-94179, which is invalid:

  • expected Jira Issue OCPBUGS-94179 to depend on a bug targeting a version in 4.22.0 and in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but no dependents were found

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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.

…t containers

Combined manual backport of openshift#8509 and openshift#8824 to release-4.21.
Introduces strict longest-prefix registry override matching and
wires overrides into CPO init container image resolution.
@avollmer-redhat
avollmer-redhat force-pushed the fix/OCPBUGS-94179-combined-backport-4.21 branch from 697d0b5 to 9c3c3ac Compare July 1, 2026 16:41
@avollmer-redhat

Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

@avollmer-redhat: This pull request references Jira Issue OCPBUGS-94179, which is invalid:

  • expected dependent Jira Issue OCPBUGS-94170 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is POST instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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.

@avollmer-redhat avollmer-redhat changed the title OCPBUGS-94179: fix registry override matching and propagation to init containers [release-4.21] OCPBUGS-94179: fix registry override matching and propagation to init containers Jul 2, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@avollmer-redhat: This pull request references Jira Issue OCPBUGS-94179, which is invalid:

  • expected dependent Jira Issue OCPBUGS-94170 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is POST instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

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

Details

In response to this:

Summary

Combined manual backport of #8509 and #8824 to release-4.21.

The cherry-pick bot could not create this backport automatically because the support/util/registryoverride/ package does not exist on release-4.21 (it was introduced on main by #8509), causing merge conflicts.

What this fixes

  1. Registry override substring matching bug (OCPBUGS-85585: tighten registry override matching to strict longest-prefix across release-image consumers #8509): RegistryMirrorProviderDecorator.Lookup() used strings.Replace which could match substrings inside hostnames (e.g. quay.io inside quay.io.example.com). Replaced with strict longest-prefix matching via new registryoverride.Replace() helper.

  2. Digest/tag separator handling (OCPBUGS-92034: fix registry override matching for digest and tag separators #8824): The strict matching from OCPBUGS-85585: tighten registry override matching to strict longest-prefix across release-image consumers #8509 only accepted / as a valid separator. Repository-level overrides failed to match digest-based references (repo@sha256:...). Fixed matchesPrefix() to also accept @ (digest) and : (tag, when source contains a path component).

  3. Init container image override propagation (OCPBUGS-85585: tighten registry override matching to strict longest-prefix across release-image consumers #8509): CPO-managed init containers (e.g. availability-prober) were not getting registry overrides applied because imageprovider.New() populated component images without running them through override logic. Added NewWithRegistryOverrides() and wired it into the HCP controller.

Root cause

Without these fixes, ValidatingAdmissionPolicies in Deny mode block HCP creation because CPO init containers still reference original registries (e.g. quay.io/redhat-user-workloads/...) instead of the configured mirror/ACR.

Changes

  • New: support/util/registryoverride/ package with Replace() and comprehensive tests (18 test cases)
  • Modified: support/releaseinfo/registry_mirror_provider.go — use registryoverride.Replace() instead of strings.Replace
  • Modified: control-plane-operator/.../imageprovider/imageprovider.go — add NewWithRegistryOverrides()
  • Modified: control-plane-operator/.../hostedcontrolplane_controller.go — wire NewWithRegistryOverrides with registry overrides from the release provider

Test plan

  • 18 unit tests for registryoverride.Replace covering boundary matching, longest-prefix, digest/tag separators, false-positive rejection, mutation safety
  • All existing releaseinfo tests pass
  • All existing imageprovider tests pass (compilation verified)

Related

/cc @muraee @sjenning @raelga

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.

@raelga raelga left a comment

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.

Cherry picks two already tested and shiped changes.

/lgtm

@avollmer-redhat

Copy link
Copy Markdown
Author

/retest-required

1 similar comment
@avollmer-redhat

Copy link
Copy Markdown
Author

/retest-required

@avollmer-redhat

Copy link
Copy Markdown
Author

/retest ci/prow/e2e-aks

1 similar comment
@avollmer-redhat

Copy link
Copy Markdown
Author

/retest ci/prow/e2e-aks

@avollmer-redhat

Copy link
Copy Markdown
Author

/test e2e-aks

@avollmer-redhat

Copy link
Copy Markdown
Author

/jira refresh

@muraee Could you /approve this PR? It is the same code as #8877 (4.22 backport) which you already approved and merged today.

@CEWong Could you add the remaining labels? You added backport-risk-assessed on #8877 — this is the identical backport for 4.21:

/label backport-risk-assessed
/label verified

All CI has been green since Jul 14.

@openshift-ci-robot

Copy link
Copy Markdown

@avollmer-redhat: This pull request references Jira Issue OCPBUGS-94179, which is invalid:

  • expected dependent Jira Issue OCPBUGS-94170 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is POST instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

@muraee Could you /approve this PR? It is the same code as #8877 (4.22 backport) which you already approved and merged today.

@CEWong Could you add the remaining labels? You added backport-risk-assessed on #8877 — this is the identical backport for 4.21:

/label backport-risk-assessed
/label verified

All CI has been green since Jul 14.

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.

@avollmer-redhat

Copy link
Copy Markdown
Author

@csrwng Could you also add the remaining labels needed to merge?

/label backport-risk-assessed
/label verified

@openshift-ci

openshift-ci Bot commented Aug 3, 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:

/jira refresh

@muraee Could you /approve this PR? It is the same code as #8877 (4.22 backport) which you already approved and merged today.

@CEWong Could you add the remaining labels? You added backport-risk-assessed on #8877 — this is the identical backport for 4.21:

/label backport-risk-assessed
/label verified

All CI has been green since Jul 14.

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 the verified Signifies that the PR passed pre-merge verification criteria label Aug 3, 2026
@openshift-ci

openshift-ci Bot commented Aug 3, 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:

@csrwng Could you also add the remaining labels needed to merge?

/label backport-risk-assessed
/label verified

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.

@muraee

muraee commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

/approve

@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: avollmer-redhat, muraee, raelga

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 3, 2026
@avollmer-redhat

Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

@avollmer-redhat: This pull request references Jira Issue OCPBUGS-94179, which is invalid:

  • expected dependent Jira Issue OCPBUGS-94170 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is MODIFIED instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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.

@celebdor

celebdor commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 5, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@celebdor: This pull request references Jira Issue OCPBUGS-94179, which is valid.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.z) matches configured target version for branch (4.21.z)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note type set to "Release Note Not Required"
  • dependent bug Jira Issue OCPBUGS-94170 is in the state Release Pending (Done), which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-94170 targets the "4.22.0" version, which is one of the valid target versions: 4.22.0
  • bug has dependents
Details

In response to this:

/jira refresh

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.

@avollmer-redhat

Copy link
Copy Markdown
Author

@csrwng @CEWong This PR is one label away from merging — all CI green, approved, lgtm, jira/valid-bug, verified are all set. Could one of you add the last required label?

/label backport-risk-assessed

This is the same code as #8877 (4.22 backport) which already merged with backport-risk-assessed. Thanks!

@openshift-ci

openshift-ci Bot commented Aug 5, 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:

@csrwng @CEWong This PR is one label away from merging — all CI green, approved, lgtm, jira/valid-bug, verified are all set. Could one of you add the last required label?

/label backport-risk-assessed

This is the same code as #8877 (4.22 backport) which already merged with backport-risk-assessed. Thanks!

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.

@csrwng csrwng added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Aug 5, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 81a0dd9 and 2 for PR HEAD 9c3c3ac in total

@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@avollmer-redhat: 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 04c25e5 into openshift:release-4.21 Aug 6, 2026
19 checks passed
@openshift-ci-robot

Copy link
Copy Markdown

@avollmer-redhat: Jira Issue Verification Checks: Jira Issue OCPBUGS-94179
✔️ 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-94179 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:

Summary

Combined manual backport of #8509 and #8824 to release-4.21.

The cherry-pick bot could not create this backport automatically because the support/util/registryoverride/ package does not exist on release-4.21 (it was introduced on main by #8509), causing merge conflicts.

What this fixes

  1. Registry override substring matching bug (OCPBUGS-85585: tighten registry override matching to strict longest-prefix across release-image consumers #8509): RegistryMirrorProviderDecorator.Lookup() used strings.Replace which could match substrings inside hostnames (e.g. quay.io inside quay.io.example.com). Replaced with strict longest-prefix matching via new registryoverride.Replace() helper.

  2. Digest/tag separator handling (OCPBUGS-92034: fix registry override matching for digest and tag separators #8824): The strict matching from OCPBUGS-85585: tighten registry override matching to strict longest-prefix across release-image consumers #8509 only accepted / as a valid separator. Repository-level overrides failed to match digest-based references (repo@sha256:...). Fixed matchesPrefix() to also accept @ (digest) and : (tag, when source contains a path component).

  3. Init container image override propagation (OCPBUGS-85585: tighten registry override matching to strict longest-prefix across release-image consumers #8509): CPO-managed init containers (e.g. availability-prober) were not getting registry overrides applied because imageprovider.New() populated component images without running them through override logic. Added NewWithRegistryOverrides() and wired it into the HCP controller.

Root cause

Without these fixes, ValidatingAdmissionPolicies in Deny mode block HCP creation because CPO init containers still reference original registries (e.g. quay.io/redhat-user-workloads/...) instead of the configured mirror/ACR.

Changes

  • New: support/util/registryoverride/ package with Replace() and comprehensive tests (18 test cases)
  • Modified: support/releaseinfo/registry_mirror_provider.go — use registryoverride.Replace() instead of strings.Replace
  • Modified: control-plane-operator/.../imageprovider/imageprovider.go — add NewWithRegistryOverrides()
  • Modified: control-plane-operator/.../hostedcontrolplane_controller.go — wire NewWithRegistryOverrides with registry overrides from the release provider

Test plan

  • 18 unit tests for registryoverride.Replace covering boundary matching, longest-prefix, digest/tag separators, false-positive rejection, mutation safety
  • All existing releaseinfo tests pass
  • All existing imageprovider tests pass (compilation verified)

Related

/cc @muraee @sjenning @raelga

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 release 4.21.0-0.nightly-2026-08-06-114003

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 area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. 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.

7 participants