Skip to content

NO-ISSUE: Update oc-mirror locations to CGW following openshift release decoupling - #10601

Open
dorzel wants to merge 2 commits into
openshift:masterfrom
dorzel:CLID-662
Open

NO-ISSUE: Update oc-mirror locations to CGW following openshift release decoupling#10601
dorzel wants to merge 2 commits into
openshift:masterfrom
dorzel:CLID-662

Conversation

@dorzel

@dorzel dorzel commented Jul 7, 2026

Copy link
Copy Markdown
Member

Changes the oc-mirror download mirror location to the new content gateway (CGW) location following the decoupling of oc-mirror from the openshift release process in version 5.0+.

See:

Summary by CodeRabbit

  • Bug Fixes
    • Improved mirror installer reliability by updating the default mirror tarball URL used when no custom URL is provided.
    • Made the release-mirroring step more resilient to transient registry/network issues by adding controlled retries with configurable counts/delays and smarter retry conditions.
  • New Features
    • Enhanced OS image stream discovery for mirroring by adding automatic derivation of source repositories, with fallbacks when primary discovery is unavailable.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 7, 2026
@openshift-ci

openshift-ci Bot commented Jul 7, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Walkthrough

The mirror utility now retries transient oc adm release mirror failures, discovers OS image stream repositories through MCO tooling or release metadata, generates registry configurations for those repositories, and uses a new default oc-mirror download URL.

Changes

Mirror reliability and OS image discovery

Layer / File(s) Summary
Release mirror retry handling
deploy/operator/mirror_utils.sh
ocp_mirror_release captures command output and retries only transient registry or network failures using configurable retry counts and delays.
OS image stream source discovery
deploy/operator/mirror_utils.sh
Sources are discovered through MCO tooling when available, with release metadata JSON as a fallback; pullspecs are normalized and deduplicated.
Registry configuration and installation
deploy/operator/mirror_utils.sh
Discovered sources are converted into registry configurations with optional exclusions, and the default OC_MIRROR_URL points to the cgw latest RHEL 9 tarball.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MirrorUtility
  participant MCO
  participant ReleaseMetadata
  participant RegistryConfig
  MirrorUtility->>MCO: Discover OS image stream sources
  MCO-->>MirrorUtility: Return image stream targets
  MirrorUtility->>ReleaseMetadata: Fall back to release JSON
  ReleaseMetadata-->>MirrorUtility: Return source repositories
  MirrorUtility->>RegistryConfig: Configure discovered repositories
Loading

Suggested reviewers: andrej1991


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error Raw oc adm release mirror output and MCO stderr are echoed unfiltered, which can leak registry hostnames and other sensitive details. Redact or suppress raw command output/stderr before logging; only emit a sanitized summary of failures and outputs.
Description check ⚠️ Warning The description gives a concise change summary and issue references but omits the required template sections for impact, testing, dependencies, and checklist details. Complete the repository template, including change classification, impacted environments, testing details, dependencies, documentation impact, and checklist items.
✅ Passed checks (13 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR only changes deploy/operator/mirror_utils.sh; no Ginkgo test declarations or titles were added or modified.
Test Structure And Quality ✅ Passed PR only changes deploy/operator/mirror_utils.sh; no Ginkgo tests were added or modified, so the test-structure checklist is not applicable.
Microshift Test Compatibility ✅ Passed Only deploy/operator/mirror_utils.sh changed; no new Ginkgo tests or MicroShift-sensitive APIs were added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo tests were added; the PR only changes an oc-mirror download URL in a shell script, so there are no SNO-specific test assumptions to review.
Topology-Aware Scheduling Compatibility ✅ Passed Only deploy/operator/mirror_utils.sh changed, and it updates mirror URL/retry helpers; no topology, replicas, node selectors, or affinity constraints were added.
Ote Binary Stdout Contract ✅ Passed Only shell function bodies changed; no top-level/main/init/TestMain/suite-setup stdout writes or OTE binary code were added, so the JSON stdout contract isn’t implicated.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests were added or modified; the only change is a shell script download URL, so the IPv6/disconnected test check is not applicable.
No-Weak-Crypto ✅ Passed Changed file only adds retry/fallback and oc-mirror URL updates; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret comparisons found.
Container-Privileges ✅ Passed PR only changes deploy/operator/mirror_utils.sh (a URL in a shell script); no container/K8s manifests were modified and no privilege flags were introduced.
Title check ✅ Passed The title clearly identifies the primary change: moving oc-mirror download locations to CGW after OpenShift release decoupling.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
deploy/operator/mirror_utils.sh (3)

232-233: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve release-metadata query failures.

Without a guaranteed pipefail, a failed oc adm release info is masked by jq returning success with no rows. That silently omits required registry mappings. Capture and validate the oc JSON before passing it to jq.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deploy/operator/mirror_utils.sh` around lines 232 - 233, Update the release
metadata flow around the oc adm release info invocation to capture its JSON
output and validate that the command succeeds before passing the result to jq.
Preserve and propagate the oc failure instead of allowing jq to mask it, then
retain the existing filtering and unique registry mapping behavior for
successful responses.

168-168: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Redact external command output before writing deployment logs.

Both commands can include private registry endpoints and other deployment-specific details.

  • deploy/operator/mirror_utils.sh#L168-L168: emit a sanitized error summary rather than the complete oc adm output.
  • deploy/operator/mirror_utils.sh#L214-L215: redact or restrict MCO stderr before forwarding it to logs.

As per coding guidelines, flag logging that may expose passwords, tokens, API keys, PII, session IDs, internal hostnames, or customer data.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deploy/operator/mirror_utils.sh` at line 168, Sanitize external command
output before deployment logging: at deploy/operator/mirror_utils.sh lines
168-168, replace the complete oc adm output emitted by the surrounding function
with a sanitized error summary; at lines 214-215, redact or restrict MCO stderr
before forwarding it to logs. Preserve the existing error handling while
ensuring private registry endpoints and other sensitive deployment details are
not logged.

Source: Coding guidelines


267-273: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Propagate source-discovery failures.

The exit status of discover_os_image_stream_sources inside process substitution is not the loop’s exit status. A failed discovery therefore produces an apparently successful, empty registries.conf section.

Proposed fix
 function registry_configs_for_os_image_stream_sources() {
+  local sources
   release_image="${1}"
   authfile="${2}"
   release_mirror_repo="${3}"
   shift 3

+  if ! sources=$(discover_os_image_stream_sources "${release_image}" "${authfile}"); then
+    return 1
+  fi
+
   while IFS= read -r source; do
     [ -n "${source}" ] || continue
     for skip_repo in "$@"; do
       [ "${source}" = "${skip_repo}" ] && continue 2
     done
     registry_config "${source}" "${release_mirror_repo}"
-  done < <(discover_os_image_stream_sources "${release_image}" "${authfile}")
+  done <<< "${sources}"
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deploy/operator/mirror_utils.sh` around lines 267 - 273, Update the loop
consuming discover_os_image_stream_sources so its failure status is captured and
propagated instead of being hidden by process substitution. Ensure
registry_config processing remains unchanged for successful discovery, while a
discovery error causes the surrounding operation to return a nonzero status
rather than generating an apparently successful empty configuration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deploy/operator/mirror_utils.sh`:
- Line 277: Replace the placeholder default assigned to OC_MIRROR_URL in the
mirror utility configuration with the finalized CGW endpoint required for
disconnected CAPI deployments, ensuring callers can still override it through
the existing environment-variable fallback.

---

Outside diff comments:
In `@deploy/operator/mirror_utils.sh`:
- Around line 232-233: Update the release metadata flow around the oc adm
release info invocation to capture its JSON output and validate that the command
succeeds before passing the result to jq. Preserve and propagate the oc failure
instead of allowing jq to mask it, then retain the existing filtering and unique
registry mapping behavior for successful responses.
- Line 168: Sanitize external command output before deployment logging: at
deploy/operator/mirror_utils.sh lines 168-168, replace the complete oc adm
output emitted by the surrounding function with a sanitized error summary; at
lines 214-215, redact or restrict MCO stderr before forwarding it to logs.
Preserve the existing error handling while ensuring private registry endpoints
and other sensitive deployment details are not logged.
- Around line 267-273: Update the loop consuming
discover_os_image_stream_sources so its failure status is captured and
propagated instead of being hidden by process substitution. Ensure
registry_config processing remains unchanged for successful discovery, while a
discovery error causes the surrounding operation to return a nonzero status
rather than generating an apparently successful empty configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c90a5152-e81e-4b87-844a-6b73b9a07f2e

📥 Commits

Reviewing files that changed from the base of the PR and between 9860c7a and d136bfe.

📒 Files selected for processing (1)
  • deploy/operator/mirror_utils.sh

Comment thread deploy/operator/mirror_utils.sh
@dorzel
dorzel marked this pull request as ready for review July 30, 2026 22:37
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 30, 2026
@openshift-ci
openshift-ci Bot requested review from eliorerz and mlorenzofr July 30, 2026 22:38
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.48%. Comparing base (9665339) to head (d136bfe).
⚠️ Report is 31 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10601   +/-   ##
=======================================
  Coverage   44.47%   44.48%           
=======================================
  Files         423      423           
  Lines       73374    73374           
=======================================
+ Hits        32634    32639    +5     
+ Misses      37821    37818    -3     
+ Partials     2919     2917    -2     

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aguidirh

Copy link
Copy Markdown

/retest

4 similar comments
@aguidirh

Copy link
Copy Markdown

/retest

@dorzel

dorzel commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

/retest

@dorzel

dorzel commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

/retest

@dorzel

dorzel commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

/retest

@danielerez

Copy link
Copy Markdown
Contributor

/approve
/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2026
@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danielerez, dorzel

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 6, 2026
@dorzel dorzel changed the title Update oc-mirror locations to CGW following openshift release decoupling NO-ISSUE: Update oc-mirror locations to CGW following openshift release decoupling Aug 6, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 6, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@dorzel: This pull request explicitly references no jira issue.

Details

In response to this:

Changes the oc-mirror download mirror location to the new content gateway (CGW) location following the decoupling of oc-mirror from the openshift release process in version 5.0+.

See:

Summary by CodeRabbit

  • Bug Fixes
  • Improved mirror installer reliability by updating the default mirror tarball URL used when no custom URL is provided.
  • Made the release-mirroring step more resilient to transient registry/network issues by adding controlled retries with configurable counts/delays and smarter retry conditions.
  • New Features
  • Enhanced OS image stream discovery for mirroring by adding automatic derivation of source repositories, with fallbacks when primary discovery is unavailable.

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-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 368458c and 2 for PR HEAD d136bfe in total

@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

@dorzel: The following test 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/edge-e2e-ai-operator-disconnected-capi d136bfe link true /test edge-e2e-ai-operator-disconnected-capi

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.

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. 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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants