Skip to content

Fix missing local registry for baremetal with MIRROR_IMAGES - #1938

Closed
rebtoor wants to merge 1 commit into
openshift-metal3:masterfrom
rebtoor:fix-baremetal-local-registry
Closed

Fix missing local registry for baremetal with MIRROR_IMAGES#1938
rebtoor wants to merge 1 commit into
openshift-metal3:masterfrom
rebtoor:fix-baremetal-local-registry

Conversation

@rebtoor

@rebtoor rebtoor commented Jul 30, 2026

Copy link
Copy Markdown

Summary

PR #1922 added an early exit 0 in 02_configure_host.sh for
NODES_PLATFORM=baremetal, which skips setup_local_registry.
This breaks environments that combine NODES_PLATFORM=baremetal
with MIRROR_IMAGES=true (e.g. virtual-baremetal CI using
sushy-emulator on libvirt VMs), because 04_setup_ironic.sh still
attempts to mirror release images into the local registry at port
5000 and gets "connection refused".

This affects downstream RHOSO CI jobs like uni04delta-ipv6 that
provision OCP via Ironic on virtual baremetal nodes and require
image mirroring for IPv6 connectivity.

Changes

Add registry setup to the baremetal early-exit path in
02_configure_host.sh:

  • If using podman registry (use_registry "podman"): start the
    registry and create REGISTRY_CREDS via podman login — mirrors
    the existing pattern in the libvirt path (lines 471–487)
  • If using quay registry (use_registry ""): start it
  • If no registry needed: create an empty {} REGISTRY_CREDS
    authfile so write_pull_secret() does not fail on the missing file

Root cause

The early-exit path introduced by #1922 assumed that baremetal
deployments never need a local registry. This is true for "real"
baremetal (standalone provisioning hosts pulling from external
registries), but not for virtual-baremetal setups that use
MIRROR_IMAGES=true to mirror OCP release images locally.

Related

Test plan

  • NODES_PLATFORM=baremetal, MIRROR_IMAGES=true: registry
    starts, oc adm release mirror succeeds
  • NODES_PLATFORM=baremetal, MIRROR_IMAGES unset: empty
    authfile created, no registry started, write_pull_secret() works
  • NODES_PLATFORM=libvirt: no behavior change (early-exit block
    not reached)

Made with Cursor

PR openshift-metal3#1922 added an early exit in 02_configure_host.sh for
NODES_PLATFORM=baremetal, which skips setup_local_registry.
This breaks environments that set NODES_PLATFORM=baremetal together
with MIRROR_IMAGES=true (e.g. virtual-baremetal CI using
sushy-emulator), because 04_setup_ironic.sh still attempts to
mirror release images into the local registry at port 5000 and
gets "connection refused".

Add registry setup to the baremetal early-exit path:
- If using podman registry: start it and create REGISTRY_CREDS
  via podman login (mirrors the pattern in the libvirt path)
- If using quay registry: start it
- If no registry needed: create an empty REGISTRY_CREDS authfile
  so write_pull_secret() does not fail on the missing file

Fixes: openshift-metal3#1922

Assisted-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-ci
openshift-ci Bot requested review from sadasu and zaneb July 30, 2026 09:59
@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tdomnesc 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 added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 30, 2026
@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown

Hi @rebtoor. Thanks for your PR.

I'm waiting for a openshift-metal3 member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@tusharjadhav3302

Copy link
Copy Markdown

Hi @rebtoor — I've consolidated your 02_configure_host.sh changes into #1937, which already had the complementary utils.sh fix for write_pull_secret(). The combined PR now covers both scenarios:

  1. Your fix: baremetal + MIRROR_IMAGES=true → registry starts (podman login, quay, or empty authfile)
  2. My fix: write_pull_secret() guarded behind use_registry "" so it doesn't crash when no registry is configured

Added you as Co-authored-by in the commit. This PR can be closed in favour of #1937 if you're happy with the consolidation.

cc @sadasu @zaneb

@rebtoor

rebtoor commented Jul 30, 2026

Copy link
Copy Markdown
Author

closed since the commit has been integrated into #1937

@rebtoor rebtoor closed this Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants