From 0bf590e50d9bbd2023301413142783e35a1f0fae Mon Sep 17 00:00:00 2001 From: Isabella Janssen Date: Fri, 27 Mar 2026 09:10:01 -0400 Subject: [PATCH] MCO: make MCN condition check on node degrade stable across tech preview and non tech preview envs --- .../machine_config/machine_config_node.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/test/extended/machine_config/machine_config_node.go b/test/extended/machine_config/machine_config_node.go index a95e852724e1..43ad1af0cd20 100644 --- a/test/extended/machine_config/machine_config_node.go +++ b/test/extended/machine_config/machine_config_node.go @@ -434,6 +434,11 @@ func ValidateMCNConditionOnNodeDegrade(oc *exutil.CLI, fixture string, isSno boo degradedNode, degradedNodeErr := GetDegradedNode(oc, poolName) o.Expect(degradedNodeErr).NotTo(o.HaveOccurred(), "Could not get degraded node.") + unknownCondition := mcfgv1.MachineConfigNodeUpdateFilesAndOS + if isFeatureGateEnabled(oc.AdminConfigClient(), "ImageModeStatusReporting") { + unknownCondition = mcfgv1.MachineConfigNodeUpdateFiles + } + // Validate MCN of degraded node // get and log MCN conditions for debugging purposes degradedNodeMCN, degradedErr = clientSet.MachineconfigurationV1().MachineConfigNodes().Get(context.TODO(), degradedNode.Name, metav1.GetOptions{}) @@ -441,9 +446,9 @@ func ValidateMCNConditionOnNodeDegrade(oc *exutil.CLI, fixture string, isSno boo nodeDegradedCondition := GetMCNCondition(degradedNodeMCN, mcfgv1.MachineConfigNodeNodeDegraded) o.Expect(nodeDegradedCondition).NotTo(o.BeNil(), "Condition 'NodeDegraded' does not exist.") framework.Logf("`NodeDegraded` condition status is `%v` with the message `%v`", nodeDegradedCondition.Status, nodeDegradedCondition.Message) - fileCondition := GetMCNCondition(degradedNodeMCN, mcfgv1.MachineConfigNodeUpdateFiles) - o.Expect(fileCondition).NotTo(o.BeNil(), "Condition 'AppliedFiles' does not exist.") - framework.Logf("`AppliedFiles` condition status is `%v` with the message `%v`", fileCondition.Status, fileCondition.Message) + fileCondition := GetMCNCondition(degradedNodeMCN, unknownCondition) + o.Expect(fileCondition).NotTo(o.BeNil(), "Condition '%v' does not exist.", unknownCondition) + framework.Logf("`%v` condition status is `%v` with the message `%v`", unknownCondition, fileCondition.Status, fileCondition.Message) executedCondition := GetMCNCondition(degradedNodeMCN, mcfgv1.MachineConfigNodeUpdateExecuted) o.Expect(executedCondition).NotTo(o.BeNil(), "Condition 'UpdateExecuted' does not exist.") framework.Logf("`UpdateExecuted` condition status is `%v` with the message `%v`", executedCondition.Status, executedCondition.Message) @@ -454,8 +459,8 @@ func ValidateMCNConditionOnNodeDegrade(oc *exutil.CLI, fixture string, isSno boo o.Expect(nodeDegradedCondition.Message).Should(o.ContainSubstring("/home/core: file exists"), "Condition 'NodeDegraded' does not have the expected message details.") framework.Logf("Validating that `UpdateExecuted` condition in '%v' MCN has a status of 'Unknown'.", degradedNodeMCN.Name) o.Expect(executedCondition.Status).Should(o.Equal(metav1.ConditionUnknown), "Condition 'UpdateExecuted' does not have the expected status of 'Unknown'.") - framework.Logf("Validating that `AppliedFilesAndOS` condition in '%v' MCN has a status of 'Unknown'.", degradedNodeMCN.Name) - o.Expect(fileCondition.Status).Should(o.Equal(metav1.ConditionUnknown), "Condition 'AppliedFilesAndOS' does not have the expected status of 'Unknown'.") + framework.Logf("Validating that `%v` condition in '%v' MCN has a status of 'Unknown'.", unknownCondition, degradedNodeMCN.Name) + o.Expect(fileCondition.Status).Should(o.Equal(metav1.ConditionUnknown), "Condition '%v' does not have the expected status of 'Unknown'.", unknownCondition) } // `ValidateMCNProperties` checks that MCNs with correct properties are created on node creation