From add6d06bcd57f5976f6ccffedf816bfbc99a7da2 Mon Sep 17 00:00:00 2001 From: Roberto Alfieri Date: Thu, 30 Jul 2026 11:59:05 +0200 Subject: [PATCH] Fix missing local registry for baremetal with MIRROR_IMAGES PR #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: #1922 Assisted-By: Claude Opus 4.6 Signed-off-by: Roberto Alfieri Co-authored-by: Cursor --- 02_configure_host.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/02_configure_host.sh b/02_configure_host.sh index 1b1ff9264..636d81c77 100755 --- a/02_configure_host.sh +++ b/02_configure_host.sh @@ -97,6 +97,25 @@ if [[ "${NODES_PLATFORM}" == "baremetal" ]]; then switch_to_internal_dns + # When MIRROR_IMAGES is configured, the local registry must be running + # before 04_setup_ironic.sh attempts to mirror release images into it. + # This covers virtual-baremetal (sushy-emulator) CI environments that + # set NODES_PLATFORM=baremetal together with MIRROR_IMAGES=true. + if use_registry "podman"; then + setup_local_registry + rm -f "${REGISTRY_CREDS}" + sudo podman login --authfile "${REGISTRY_CREDS}" \ + -u "${REGISTRY_USER}" -p "${REGISTRY_PASS}" \ + "${LOCAL_REGISTRY_DNS_NAME}":"${LOCAL_REGISTRY_PORT}" + elif use_registry ""; then + setup_local_registry + else + echo '{}' | sudo dd of="${REGISTRY_CREDS}" + fi + if [ -f "${REGISTRY_CREDS}" ]; then + sudo chown "$USER":"$USER" "${REGISTRY_CREDS}" + fi + exit 0 fi