From 599e19d8144fdc1c8abed5a3578444bcee3d3fae Mon Sep 17 00:00:00 2001 From: Sarthak Purohit Date: Tue, 8 Sep 2026 00:44:17 +0530 Subject: [PATCH] NO-ISSUE: Fix pre-OS Image Stream OS validation for OKD clusters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The validatePreOSImageStreamsNodeOS function hardcodes an assertion that pre-OS Image Stream clusters should use RHEL CoreOS 9 nodes. However, OKD SCOS clusters use CentOS Stream CoreOS 10 even in pre-OS Image Stream releases (4.22 and earlier). This causes the [sig-ci] [Early] prow job name should match os version test to fail deterministically on every OKD SCOS 4.22 -> 5.0 upgrade job (aws-upgrade-minor), because the [Early] tests run against the 4.22 cluster before the upgrade begins. The 4.22 OKD nodes report "CentOS Stream CoreOS 10" but the test asserts "CoreOS 9.". The actual cluster upgrade succeeds — this is purely a test assertion bug in the pre-OSImageStream fallback path. PR #31487 (ff28c753e9) correctly added OKD detection and set targetStream = "centos-10", but did not update the validatePreOSImageStreamsNodeOS fallback which is reached when the OSImageStream CR does not exist (i.e., all pre-4.23 clusters). This change passes the isOKD flag into validatePreOSImageStreamsNodeOS so it expects CentOS Stream CoreOS 10 for OKD clusters. Signed-off-by: Sarthak Purohit --- test/extended/ci/job_names.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/test/extended/ci/job_names.go b/test/extended/ci/job_names.go index 91c3b8405149..ed84408cd1f0 100644 --- a/test/extended/ci/job_names.go +++ b/test/extended/ci/job_names.go @@ -196,14 +196,23 @@ var _ = g.Describe("[sig-ci] [Early] prow job name", func() { }) }) -func validatePreOSImageStreamsNodeOS(coreClient kclientset.Interface) { - // In clusters with no OSImageStreams the nodes should be always RHEL 9 +func validatePreOSImageStreamsNodeOS(coreClient kclientset.Interface, isOKD bool) { nodes, err := coreClient.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{}) o.Expect(err).NotTo(o.HaveOccurred(), "Error listing nodes") + // OKD SCOS clusters use CentOS Stream CoreOS 10 even in pre-OS Image Stream + // releases (4.22 and earlier). OCP clusters use RHEL CoreOS 9. + expectedSubstring := "CoreOS 9." + expectedDesc := "RHEL 9" + if isOKD { + expectedSubstring = "CentOS Stream CoreOS 10" + expectedDesc = "CentOS Stream CoreOS 10" + } + for _, node := range nodes.Items { osImage := node.Status.NodeInfo.OSImage - o.Expect(osImage).To(o.ContainSubstring("CoreOS 9."), "Pre OS Image Stream cluster should use RHEL 9 nodes") + o.Expect(osImage).To(o.ContainSubstring(expectedSubstring), + "Pre OS Image Stream cluster should use %s nodes", expectedDesc) } } @@ -307,8 +316,8 @@ func validateStandaloneNodeOS(oc *exutil.CLI, jobName, rawJobName string) { clusterSemver, err := utilversion.ParseGeneric(clusterVersion.Status.Desired.Version) o.Expect(err).NotTo(o.HaveOccurred(), "Error parsing ClusterVersion desired version %v", err) if clusterSemver.LessThan(utilversion.MustParseSemantic("4.23.0")) { - // Pre-OS Image Streams GA. OS was always RHEL 9 - validatePreOSImageStreamsNodeOS(oc.AdminKubeClient()) + // Pre-OS Image Streams GA. OS was always RHEL 9 for OCP, CentOS Stream CoreOS 10 for OKD + validatePreOSImageStreamsNodeOS(oc.AdminKubeClient(), isOKD) // Return now, the rest of the test is based on the presence of OSImageStream return }