Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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-<workflow>_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-<workflow>_JobRunning (e.g. tnf-auth-job-master-0-64736551_JobRunning)
// - PascalCase (OCPBUGS-84695+): TNF<Workflow>Job_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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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},
}
Expand Down