From 04cdb4e48e28bfab965ca11f204f05eea133e0aa Mon Sep 17 00:00:00 2001 From: Robby Cochran Date: Wed, 25 Mar 2026 09:04:22 -0700 Subject: [PATCH 1/4] X-Smart-Branch-Parent: master From 8faad737737e9c65131073f2c4361ad5a712a3bb Mon Sep 17 00:00:00 2001 From: Robby Cochran Date: Wed, 25 Mar 2026 12:06:27 -0700 Subject: [PATCH 2/4] Add RHCOS 10 integration tests for OCP 4.22+ OCP 4.22+ splits RHCOS boot images into separate files by RHEL version (coreos-rhel-9.json and coreos-rhel-10.json) instead of the single rhcos.json used by earlier releases. Update fetch_ocp_rhcos_bootimage.sh to accept an optional rhel-variant argument that selects the correct JSON file, while remaining backward compatible for older OCP versions. Consolidate the RHCOS image list to one image per RHEL minor version, keeping the newest OCP release for each track: - RHEL 10.2 (OCP 4.22), RHEL 9.6 (OCP 4.22), RHEL 9.4 (OCP 4.18), RHEL 9.2 (OCP 4.14), RHEL 8.6 (OCP 4.12) Co-Authored-By: Claude Opus 4.6 (1M context) --- ansible/group_vars/all.yml | 8 ++++---- ansible/scripts/fetch_ocp_rhcos_bootimage.sh | 12 ++++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 72237f4373..fdab540e84 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -72,9 +72,9 @@ virtual_machines: rhcos: project: rhcos-cloud images: - - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.19') }}" + - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.22 x86_64.images.gcp.name rhel-10') }}" + - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.22 x86_64.images.gcp.name rhel-9') }}" - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.18') }}" - - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.16') }}" - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.14') }}" - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.12') }}" username: core @@ -93,9 +93,9 @@ virtual_machines: arch: arm64 machine_type: t2a-standard-2 images: - - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.19 aarch64.images.gcp.name') }}" + - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.22 aarch64.images.gcp.name rhel-10') }}" + - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.22 aarch64.images.gcp.name rhel-9') }}" - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.18 aarch64.images.gcp.name') }}" - - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.16 aarch64.images.gcp.name') }}" username: core ignition: ignition: diff --git a/ansible/scripts/fetch_ocp_rhcos_bootimage.sh b/ansible/scripts/fetch_ocp_rhcos_bootimage.sh index d90f57e016..e8034a4fb6 100755 --- a/ansible/scripts/fetch_ocp_rhcos_bootimage.sh +++ b/ansible/scripts/fetch_ocp_rhcos_bootimage.sh @@ -1,7 +1,7 @@ #!/bin/bash if [ -z "$1" ]; then - echo "Usage: $0 []" + echo "Usage: $0 [] []" exit 1 fi @@ -10,7 +10,15 @@ OCP_VERSION=$1 # Json path with architecture and image name, e.g., x86_64.images.gcp.name or s390x.artifacts.ibmcloud.release JSONPATH=${2:-"x86_64.images.gcp.name"} -URL="https://raw.githubusercontent.com/openshift/installer/release-${OCP_VERSION}/data/data/coreos/rhcos.json" +# Optional RHEL variant (e.g., rhel-9, rhel-10) for OCP 4.22+ which splits +# RHCOS images into separate coreos-rhel-9.json and coreos-rhel-10.json files. +RHEL_VARIANT=${3:-""} + +if [ -n "$RHEL_VARIANT" ]; then + URL="https://raw.githubusercontent.com/openshift/installer/release-${OCP_VERSION}/data/data/coreos/coreos-${RHEL_VARIANT}.json" +else + URL="https://raw.githubusercontent.com/openshift/installer/release-${OCP_VERSION}/data/data/coreos/rhcos.json" +fi json_data=$(curl --retry 5 --retry-delay 2 -sS "$URL") if [ -z "$json_data" ]; then From c23caaa1cc41089d1727b1ff5bd1ca0138d30190 Mon Sep 17 00:00:00 2001 From: Robby Cochran Date: Wed, 25 Mar 2026 12:29:51 -0700 Subject: [PATCH 3/4] Add OCP version to RHCOS VM names for 4.22+ images For OCP 4.22+ where images are fetched via the split coreos-rhel-*.json format, embed the OCP version into the VM display name so VMs are easily distinguishable (e.g., ci-rhcos-422-10-2-2- instead of ci-rhcos-10-2-20260-). The script now outputs display_name|gcp_image when a variant is specified, and by-image.yml splits on '|' to use the display name for VM naming while using the actual GCP image name for the image lookup. For old-style entries without '|', behavior is unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) --- ansible/roles/create-all-vms/tasks/by-image.yml | 12 ++++++++---- ansible/scripts/fetch_ocp_rhcos_bootimage.sh | 13 ++++++++++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ansible/roles/create-all-vms/tasks/by-image.yml b/ansible/roles/create-all-vms/tasks/by-image.yml index 6584ba2ed9..1799f1331e 100644 --- a/ansible/roles/create-all-vms/tasks/by-image.yml +++ b/ansible/roles/create-all-vms/tasks/by-image.yml @@ -3,10 +3,14 @@ - include_vars: s390x.yml - set_fact: - vm_hashable_name: "{{ item.1 }}-{{ job_id }}" - vm_image_short: "{{ item.1 | truncate(16, True, '') }}" + vm_display_name: "{{ item.1.split('|')[0] }}" + vm_gcp_image: "{{ item.1.split('|')[-1] }}" arch: "{{ item.0.value.arch | default('amd64') }}" +- set_fact: + vm_hashable_name: "{{ vm_display_name }}-{{ job_id }}" + vm_image_short: "{{ vm_display_name | truncate(16, True, '') }}" + - set_fact: vm_hashed_name: "{{ vm_hashable_name | hash('md5') | truncate(8, True, '') }}" @@ -37,9 +41,9 @@ # still populate the family, since it is used as a label to differentiate # VMs vm_family: "{{ item.0.key }}" - vm_image: "{{ item.1 | truncate(63, True, '') }}" + vm_image: "{{ vm_gcp_image | truncate(63, True, '') }}" vm_platform: "{{ item.0.key }}" - vm_config: "{{ item.1 }}" + vm_config: "{{ vm_display_name }}" vm_collection_method: "{{ collection_method | default('any') | replace('-', '_') }}" vm_available_zones: "{{ gcp_available_zones }}" vm_ignition: "{{ item.0.value.ignition | default({}) }}" diff --git a/ansible/scripts/fetch_ocp_rhcos_bootimage.sh b/ansible/scripts/fetch_ocp_rhcos_bootimage.sh index e8034a4fb6..86206a3f89 100755 --- a/ansible/scripts/fetch_ocp_rhcos_bootimage.sh +++ b/ansible/scripts/fetch_ocp_rhcos_bootimage.sh @@ -31,4 +31,15 @@ if [ "$image_name" == "null" ]; then echo "Failed to parse JSON data or path does not exist" exit 1 fi -echo "$image_name" + +# When using the split format (rhel-variant specified), output both a display +# name (with OCP version embedded) and the actual GCP image name, separated +# by '|'. This allows VMs to be easily distinguishable by OCP version. +# e.g., rhcos-422-10-2-20260217-0-gcp-x86-64|rhcos-10-2-20260217-0-gcp-x86-64 +if [ -n "$RHEL_VARIANT" ]; then + ocp_short="${OCP_VERSION//./}" + display_name="${image_name/rhcos-/rhcos-${ocp_short}-}" + echo "${display_name}|${image_name}" +else + echo "$image_name" +fi From 11d303ac48c55824748575ed4606816a5ce57d37 Mon Sep 17 00:00:00 2001 From: Robby Cochran Date: Wed, 25 Mar 2026 12:33:48 -0700 Subject: [PATCH 4/4] Revert "Add OCP version to RHCOS VM names for 4.22+ images" This reverts commit c23caaa1cc41089d1727b1ff5bd1ca0138d30190. --- ansible/roles/create-all-vms/tasks/by-image.yml | 12 ++++-------- ansible/scripts/fetch_ocp_rhcos_bootimage.sh | 13 +------------ 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/ansible/roles/create-all-vms/tasks/by-image.yml b/ansible/roles/create-all-vms/tasks/by-image.yml index 1799f1331e..6584ba2ed9 100644 --- a/ansible/roles/create-all-vms/tasks/by-image.yml +++ b/ansible/roles/create-all-vms/tasks/by-image.yml @@ -3,14 +3,10 @@ - include_vars: s390x.yml - set_fact: - vm_display_name: "{{ item.1.split('|')[0] }}" - vm_gcp_image: "{{ item.1.split('|')[-1] }}" + vm_hashable_name: "{{ item.1 }}-{{ job_id }}" + vm_image_short: "{{ item.1 | truncate(16, True, '') }}" arch: "{{ item.0.value.arch | default('amd64') }}" -- set_fact: - vm_hashable_name: "{{ vm_display_name }}-{{ job_id }}" - vm_image_short: "{{ vm_display_name | truncate(16, True, '') }}" - - set_fact: vm_hashed_name: "{{ vm_hashable_name | hash('md5') | truncate(8, True, '') }}" @@ -41,9 +37,9 @@ # still populate the family, since it is used as a label to differentiate # VMs vm_family: "{{ item.0.key }}" - vm_image: "{{ vm_gcp_image | truncate(63, True, '') }}" + vm_image: "{{ item.1 | truncate(63, True, '') }}" vm_platform: "{{ item.0.key }}" - vm_config: "{{ vm_display_name }}" + vm_config: "{{ item.1 }}" vm_collection_method: "{{ collection_method | default('any') | replace('-', '_') }}" vm_available_zones: "{{ gcp_available_zones }}" vm_ignition: "{{ item.0.value.ignition | default({}) }}" diff --git a/ansible/scripts/fetch_ocp_rhcos_bootimage.sh b/ansible/scripts/fetch_ocp_rhcos_bootimage.sh index 86206a3f89..e8034a4fb6 100755 --- a/ansible/scripts/fetch_ocp_rhcos_bootimage.sh +++ b/ansible/scripts/fetch_ocp_rhcos_bootimage.sh @@ -31,15 +31,4 @@ if [ "$image_name" == "null" ]; then echo "Failed to parse JSON data or path does not exist" exit 1 fi - -# When using the split format (rhel-variant specified), output both a display -# name (with OCP version embedded) and the actual GCP image name, separated -# by '|'. This allows VMs to be easily distinguishable by OCP version. -# e.g., rhcos-422-10-2-20260217-0-gcp-x86-64|rhcos-10-2-20260217-0-gcp-x86-64 -if [ -n "$RHEL_VARIANT" ]; then - ocp_short="${OCP_VERSION//./}" - display_name="${image_name/rhcos-/rhcos-${ocp_short}-}" - echo "${display_name}|${image_name}" -else - echo "$image_name" -fi +echo "$image_name"