From bbfb7c0f74060f894166121ca3f61e2dc3b8c44b Mon Sep 17 00:00:00 2001 From: ehila Date: Mon, 10 Aug 2026 12:28:59 +0300 Subject: [PATCH] monitortests: recognize PascalCase TNF JobRunning CO reasons CEO OCPBUGS-84695 renamed TNF job condition types to PascalCase, so etcd Available blips now report TNFSetupJob_JobRunning instead of tnf-setup-job_JobRunning. Accept both shapes in the DualReplica exception. Co-authored-by: Cursor Signed-off-by: ehila --- .../legacycvomonitortests/operators.go | 10 +++++++--- .../legacycvomonitortests/operators_test.go | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pkg/monitortests/clusterversionoperator/legacycvomonitortests/operators.go b/pkg/monitortests/clusterversionoperator/legacycvomonitortests/operators.go index 36ed81a91453..3af608055c79 100644 --- a/pkg/monitortests/clusterversionoperator/legacycvomonitortests/operators.go +++ b/pkg/monitortests/clusterversionoperator/legacycvomonitortests/operators.go @@ -132,10 +132,14 @@ func getControlPlaneTopology(clientConfig *rest.Config) (configv1.TopologyMode, // isTNFJobClusterOperatorReason matches ClusterOperator condition Reason values emitted while // two-node fencing (TNF) batch Jobs run in openshift-etcd. The cluster-etcd-operator maps -// active Job state into etcd's ClusterOperator with reasons shaped like -// tnf-_JobRunning (including a per-job hash suffix on some Jobs, e.g. tnf-auth-job-master-0-64736551_JobRunning). +// active Job state into etcd's ClusterOperator with reasons shaped like: +// - legacy kebab-case: tnf-_JobRunning (e.g. tnf-auth-job-master-0-64736551_JobRunning) +// - PascalCase (OCPBUGS-84695+): TNFJob_JobRunning (e.g. TNFSetupJob_JobRunning) func isTNFJobClusterOperatorReason(reason string) bool { - return strings.HasPrefix(reason, "tnf-") && strings.HasSuffix(reason, "_JobRunning") + if !strings.HasSuffix(reason, "_JobRunning") { + return false + } + return strings.HasPrefix(reason, "tnf-") || strings.HasPrefix(reason, "TNF") } // isInUpgradeWindow determines if the given eventInterval falls within an upgrade window. diff --git a/pkg/monitortests/clusterversionoperator/legacycvomonitortests/operators_test.go b/pkg/monitortests/clusterversionoperator/legacycvomonitortests/operators_test.go index 9087dd1e645a..ecdb11142232 100644 --- a/pkg/monitortests/clusterversionoperator/legacycvomonitortests/operators_test.go +++ b/pkg/monitortests/clusterversionoperator/legacycvomonitortests/operators_test.go @@ -472,9 +472,15 @@ func TestIsTNFJobClusterOperatorReason(t *testing.T) { {"tnf-auth-job-master-0-64736551_JobRunning", true}, {"tnf-update-setup-job-master-1-abc12345_JobRunning", true}, {"tnf-after-setup-job-master-0-deadbeef_JobRunning", true}, + {"TNFSetupJob_JobRunning", true}, + {"TNFFencingJob_JobRunning", true}, + {"TNFAuthJobMaster064736551_JobRunning", true}, + {"TNFUpdateSetupJob_JobRunning", true}, + {"TNFAfterSetupJobMaster0deadbeef_JobRunning", true}, {"EtcdMembersProgressing", false}, {"NodeInstaller_InstallerPodRunning", false}, {"tnf-setup-job_JobComplete", false}, + {"TNFSetupJob_JobComplete", false}, {"setup-job_JobRunning", false}, {"", false}, }