OCPBUGS-100315: Fix baremetal registry and pull secret after #1922 - #1937
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @tusharjadhav3302. 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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
ci-framework has a workaround merged (openstack-k8s-operators/ci-framework#4078) that pre-creates the empty file. This PR fixes the root cause in dev-scripts itself so other consumers are not affected. |
fonta-rh
left a comment
There was a problem hiding this comment.
Thanks for such a quick fix. I'd update the "quay" to "" if possible, to make it clearer that we're looking for a non-registry condition. It does work, though, I think, so it's not a blocker. Approving all the same (just informative, I don't have permissions)
|
|
||
| # Other scripts may read REGISTRY_CREDS even when local registry mirroring | ||
| # is disabled; ensure a valid empty authfile exists before the early return. | ||
| if ! use_registry "quay"; then |
There was a problem hiding this comment.
Are you using "quay" here because that's what is on the libvirt path? I think this works but it might be a little clearer if we also use "" like in utils.sh (there's nothing special about quay here, it's just not podman, I think). This also catches "podman" registry, which might not matter but it might also be unintended
There was a problem hiding this comment.
@fonta-rh
Updated to use_registry "" to match the guard in utils.sh.
Thanks for the review.
85f8453 to
fe210fd
Compare
|
/ok-to-test |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
fe210fd to
a4a05ad
Compare
|
/lgtm |
|
@imatza-rh: changing LGTM is restricted to collaborators DetailsIn response to this:
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. |
|
/retitle OCPBUGS-100315: Fix baremetal registry and pull secret after #1922 |
|
/retest-required |
|
One possible gap in the In the libvirt path, an Suggest adding the sudo sed -i "/${LOCAL_REGISTRY_DNS_NAME}/d" /etc/hosts
echo "${PROVISIONING_HOST_EXTERNAL_IP} ${LOCAL_REGISTRY_DNS_NAME}" | sudo tee -a /etc/hosts(and possibly a dnsmasq host record so cluster nodes can resolve the mirror as well). This message was generated using AI. Please verify before acting on it. |
PR openshift-metal3#1922 introduced NODES_PLATFORM=baremetal support for agent-based installs but left gaps in the early-exit path of 02_configure_host.sh: 1. LOCAL_REGISTRY_DNS_NAME (default virthost.<cluster>.<domain>) has no /etc/hosts entry. The libvirt path adds this at line ~480, but that code sits after the `exit 0` and never runs for baremetal deployments. Without it, podman login and release-image mirroring fail on name resolution. 2. When MIRROR_IMAGES=true the local registry is not started and no podman login creates the authfile, causing downstream scripts to fail reading REGISTRY_CREDS. 3. write_pull_secret() unconditionally merges REGISTRY_CREDS into the combined pull secret even when no local registry is configured, injecting a blank or stale authfile. Add the same sed+tee /etc/hosts pattern from the libvirt path, set up the local registry and authfile when mirroring is enabled, and gate the REGISTRY_CREDS merge in write_pull_secret() behind use_registry checks. Signed-off-by: tusharjadhav3302 <tjadhav@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
a4a05ad to
31e0472
Compare
Added /etc/hosts entry to the baremetal block |
|
If I understand correctly, failure of |
|
@tusharjadhav3302: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Summary
Fixes two regressions introduced by #1922 where the early
exit 0in02_configure_host.shforNODES_PLATFORM=baremetalskipped both localregistry setup and
REGISTRY_CREDSfile creation.Problems fixed
1. Baremetal without mirroring (
MIRROR_IMAGESunset)write_pull_secret()inutils.shunconditionally mergedREGISTRY_CREDS(
private-mirror-ocp.json), causing:Affects ShiftStack/RHOSO CI jobs on real baremetal hardware.
2. Baremetal with mirroring (
MIRROR_IMAGES=true)The local registry at port 5000 never starts, causing
04_setup_ironic.shto fail with "connection refused" when mirroring release images.
Affects virtual-baremetal CI using sushy-emulator (e.g. RHOSO
uni04delta-ipv6jobs).Changes
02_configure_host.sh— registry setup in baremetal early-exit pathuse_registry "podman": starts registry, createsREGISTRY_CREDSvia podman loginuse_registry ""(quay): starts registry{}authfile forwrite_pull_secret()compatibilityutils.sh— conditional REGISTRY_CREDS merge in write_pull_secret()REGISTRY_CREDSmerge behinduse_registry ""checkOPENSHIFT_CI=trueand the standard CI_TOKEN code pathsRoot cause
#1922 assumed baremetal deployments never need a local registry. This is
true for "real" baremetal (standalone provisioning hosts pulling from
external registries), but not for:
MIRROR_IMAGES=truewrite_pull_secret()is called without mirroringTest plan
NODES_PLATFORM=baremetal,MIRROR_IMAGESunset: empty authfile created,write_pull_secret()succeeds without registryNODES_PLATFORM=baremetal,MIRROR_IMAGES=true: registry starts,oc adm release mirrorsucceedsNODES_PLATFORM=libvirt: no behavior change (early-exit block not reached)Related