Skip to content

Commit 36e2d79

Browse files
committed
Address review comments
1 parent e9c77aa commit 36e2d79

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

pkg/monitortests/clusterversionoperator/legacycvomonitortests/monitortest.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ func (w *legacyMonitorTests) EvaluateTestsFromConstructedIntervals(ctx context.C
9595
if err != nil {
9696
e2e.Logf("failed to get control plane topology: %v", err)
9797
}
98-
singleNode := topology == configv1.SingleReplicaTopologyMode
9998

10099
if isUpgrade {
101100
junits = append(junits, testUpgradeOperatorStateTransitions(finalIntervals, w.adminRESTConfig, topology)...)
@@ -105,7 +104,7 @@ func (w *legacyMonitorTests) EvaluateTestsFromConstructedIntervals(ctx context.C
105104
}
106105
junits = append(junits, testUpgradeOperatorProgressingStateTransitions(finalIntervals, level == patchUpgradeLevel, topology)...)
107106
} else {
108-
junits = append(junits, testStableSystemOperatorStateTransitions(finalIntervals, singleNode)...)
107+
junits = append(junits, testStableSystemOperatorStateTransitions(finalIntervals, topology)...)
109108
}
110109

111110
return junits, nil

pkg/monitortests/clusterversionoperator/legacycvomonitortests/operators.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func checkAuthenticationAvailableExceptions(condition *configv1.ClusterOperatorS
4646
return false
4747
}
4848

49-
func testStableSystemOperatorStateTransitions(events monitorapi.Intervals, singleNode bool) []*junitapi.JUnitTestCase {
49+
func testStableSystemOperatorStateTransitions(events monitorapi.Intervals, topology configv1.TopologyMode) []*junitapi.JUnitTestCase {
5050
except := func(operator string, condition *configv1.ClusterOperatorStatusCondition, _ monitorapi.Interval) string {
5151
if condition.Status == configv1.ConditionTrue {
5252
if condition.Type == configv1.OperatorAvailable {
@@ -111,7 +111,7 @@ func testStableSystemOperatorStateTransitions(events monitorapi.Intervals, singl
111111
return "We are not worried about other operator condition blips for stable-system tests yet."
112112
}
113113

114-
return testOperatorStateTransitions(events, []configv1.ClusterStatusConditionType{configv1.OperatorAvailable, configv1.OperatorDegraded}, except, false, singleNode)
114+
return testOperatorStateTransitions(events, []configv1.ClusterStatusConditionType{configv1.OperatorAvailable, configv1.OperatorDegraded}, except, false, topology)
115115
}
116116

117117
func getControlPlaneTopology(clientConfig *rest.Config) (configv1.TopologyMode, error) {
@@ -413,7 +413,7 @@ func testUpgradeOperatorStateTransitions(events monitorapi.Intervals, clientConf
413413
return ""
414414
}
415415

416-
return testOperatorStateTransitions(events, []configv1.ClusterStatusConditionType{configv1.OperatorAvailable, configv1.OperatorDegraded}, except, true, topology == configv1.SingleReplicaTopologyMode)
416+
return testOperatorStateTransitions(events, []configv1.ClusterStatusConditionType{configv1.OperatorAvailable, configv1.OperatorDegraded}, except, true, topology)
417417
}
418418

419419
func isVSphere(config *rest.Config) (bool, error) {
@@ -464,7 +464,7 @@ func checkReplicas(namespace string, operator string, clientConfig *rest.Config)
464464
return 0, fmt.Errorf("Error fetching replicas")
465465
}
466466

467-
func testOperatorStateTransitions(events monitorapi.Intervals, conditionTypes []configv1.ClusterStatusConditionType, except exceptionCallback, upgrade, singleNode bool) []*junitapi.JUnitTestCase {
467+
func testOperatorStateTransitions(events monitorapi.Intervals, conditionTypes []configv1.ClusterStatusConditionType, except exceptionCallback, upgrade bool, topology configv1.TopologyMode) []*junitapi.JUnitTestCase {
468468
ret := []*junitapi.JUnitTestCase{}
469469

470470
var start, stop time.Time
@@ -485,8 +485,7 @@ func testOperatorStateTransitions(events monitorapi.Intervals, conditionTypes []
485485
bzComponent := platformidentification.GetBugzillaComponentForOperator(operatorName)
486486
testName := fmt.Sprintf("[bz-%v] clusteroperator/%v should not change condition/%v", bzComponent, operatorName, conditionType)
487487
operatorEvents := eventsByOperator[operatorName]
488-
if singleNode {
489-
// SingleNode is expected to go Available=False and Degraded=True for most / all operators during upgrade
488+
if topology == configv1.SingleReplicaTopologyMode {
490489
ret = append(ret, &junitapi.JUnitTestCase{
491490
Name: testName,
492491
SkipMessage: &junitapi.SkipMessage{

0 commit comments

Comments
 (0)