From a86d92773db3c0f3013c8ad3037f47a027948396 Mon Sep 17 00:00:00 2001 From: Honza Pokorny Date: Tue, 12 May 2026 18:17:19 -0300 Subject: [PATCH] Add WORKER_COREOS_STREAM to override CoreOS stream for workers Allow deploying worker nodes with a different CoreOS stream than the default. When WORKER_COREOS_STREAM is set (e.g. "rhel-10"), the worker BMH manifests and MachineSet hostSelector are patched to use the specified stream label, and a MachineConfigPool manifest is generated to set osImageStream for the worker pool. This enables testing heterogeneous clusters where workers boot with a different IPA and on-disk OS stream than control-plane nodes. Co-Authored-By: Claude Opus 4.6 --- config_example.sh | 10 ++++++++++ utils.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/config_example.sh b/config_example.sh index a184c5b53..cd1cbae30 100755 --- a/config_example.sh +++ b/config_example.sh @@ -619,6 +619,16 @@ set -x #export WORKER_DISK=60 #export WORKER_VCPU=4 +# WORKER_COREOS_STREAM - +# Override the CoreOS stream label on worker BareMetalHost manifests and the +# worker MachineSet hostSelector. This controls which IPA (kernel/initrd/rootfs) +# is used during PXE boot for worker nodes. For example, set to "rhel-10" to +# boot workers with the RHEL 10 IPA while masters remain on the default stream. +# Requires matching stream-prefixed images in the machine-os-images container. +# Default: unset (use the installer's default, typically "rhel-9"). +# +#export WORKER_COREOS_STREAM=rhel-10 + # NUM_EXTRA_WORKERS - Indicate number of extra VMs to create but not deploy. # Default: 0 # diff --git a/utils.sh b/utils.sh index 5d295fc8d..375e39599 100755 --- a/utils.sh +++ b/utils.sh @@ -183,6 +183,41 @@ function create_cluster() { sed -i s/"watchAllNamespaces: false"/"watchAllNamespaces: true"/ "${assets_dir}/openshift/99_baremetal-provisioning-config.yaml" fi + if [[ -n "${WORKER_COREOS_STREAM:-}" ]]; then + # Patch worker BMH manifests to use the specified CoreOS stream. + # This controls which IPA (kernel/initrd/rootfs) version is used + # during PXE boot for worker nodes. + for bmh_file in "${assets_dir}"/openshift/99_openshift-cluster-api_hosts-*.yaml; do + if ! grep -q 'installer.openshift.io/role: control-plane' "${bmh_file}"; then + sed -i "s/coreos.openshift.io\/stream: .*/coreos.openshift.io\/stream: ${WORKER_COREOS_STREAM}/" "${bmh_file}" + fi + done + # Patch worker MachineSet hostSelector to match the new stream + for ms_file in "${assets_dir}"/openshift/99_openshift-cluster-api_worker-machineset-*.yaml; do + sed -i "s/coreos.openshift.io\/stream: .*/coreos.openshift.io\/stream: ${WORKER_COREOS_STREAM}/" "${ms_file}" + done + # Set the worker MachineConfigPool to use the specified stream for + # the on-disk OS. Requires the OSStreams feature gate (TechPreviewNoUpgrade). + cat > "${assets_dir}/openshift/99_worker-osimagestream.yaml" <