@@ -14,7 +14,7 @@ import (
14
14
"github.com/sirupsen/logrus"
15
15
16
16
configv1 "github.com/openshift/api/config/v1"
17
- clientconfigv1 "github.com/openshift/client-go/config/clientset/versioned"
17
+ clientconfigv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1 "
18
18
"github.com/openshift/origin/pkg/monitor/monitorapi"
19
19
"github.com/openshift/origin/pkg/monitortestlibrary/platformidentification"
20
20
platformidentification2 "github.com/openshift/origin/pkg/monitortestlibrary/platformidentification"
@@ -46,11 +46,11 @@ func checkAuthenticationAvailableExceptions(condition *configv1.ClusterOperatorS
46
46
}
47
47
48
48
func testStableSystemOperatorStateTransitions (events monitorapi.Intervals , clientConfig * rest.Config ) []* junitapi.JUnitTestCase {
49
- isSingleNode , err := isSingleNodeCheck (clientConfig )
49
+ topology , err := getControlPlaneTopology (clientConfig )
50
50
if err != nil {
51
- logrus .Warnf ("Error checking for Single Node configuration on upgrade (unable to make exception): %v" , err )
52
- isSingleNode = false
51
+ logrus .Warnf ("Error checking for ControlPlaneTopology configuration (unable to make topology exceptions): %v" , err )
53
52
}
53
+ isSingleNode := topology == configv1 .SingleReplicaTopologyMode
54
54
55
55
except := func (operator string , condition * configv1.ClusterOperatorStatusCondition , _ monitorapi.Interval , clientConfig * rest.Config ) (string , error ) {
56
56
if condition .Status == configv1 .ConditionTrue {
@@ -147,13 +147,22 @@ func testStableSystemOperatorStateTransitions(events monitorapi.Intervals, clien
147
147
return testOperatorStateTransitions (events , []configv1.ClusterStatusConditionType {configv1 .OperatorAvailable , configv1 .OperatorDegraded }, except , clientConfig )
148
148
}
149
149
150
- func isSingleNodeCheck (clientConfig * rest.Config ) (bool , error ) {
150
+ func getControlPlaneTopology (clientConfig * rest.Config ) (configv1. TopologyMode , error ) {
151
151
configClient , err := clientconfigv1 .NewForConfig (clientConfig )
152
152
if err != nil {
153
153
logrus .WithError (err ).Error ("Error creating config client to check for Single Node configuration" )
154
- return false , err
154
+ return "" , err
155
155
}
156
- return exutil .IsSingleNode (context .Background (), configClient )
156
+
157
+ topo , err := exutil .GetControlPlaneTopologyFromConfigClient (configClient )
158
+ if err != nil {
159
+ return "" , err
160
+ }
161
+ // Should not happen since the error should be returned if the topology is nil in the previous call, but just in case
162
+ if topo == nil {
163
+ return "" , fmt .Errorf ("when fetching control plane topology, the topology was nil, this is extremely unusual" )
164
+ }
165
+ return * topo , nil
157
166
}
158
167
159
168
// isInUpgradeWindow determines if the given eventInterval falls within an upgrade window.
@@ -239,12 +248,14 @@ func isInUpgradeWindow(upgradeWindows []*upgradeWindowHolder, eventInterval moni
239
248
240
249
func testUpgradeOperatorStateTransitions (events monitorapi.Intervals , clientConfig * rest.Config ) []* junitapi.JUnitTestCase {
241
250
upgradeWindows := getUpgradeWindows (events )
242
- isSingleNode , err := isSingleNodeCheck (clientConfig )
251
+ topology , err := getControlPlaneTopology (clientConfig )
243
252
if err != nil {
244
- logrus .Warnf ("Error checking for Single Node configuration on upgrade (unable to make exception): %v" , err )
245
- isSingleNode = false
253
+ logrus .Warnf ("Error checking for ControlPlaneTopology configuration on upgrade (unable to make topology exceptions): %v" , err )
246
254
}
247
255
256
+ isSingleNode := topology == configv1 .SingleReplicaTopologyMode
257
+ isTwoNode := topology == configv1 .HighlyAvailableArbiterMode || topology == configv1 .DualReplicaTopologyMode
258
+
248
259
except := func (operator string , condition * configv1.ClusterOperatorStatusCondition , eventInterval monitorapi.Interval , clientConfig * rest.Config ) (string , error ) {
249
260
if condition .Status == configv1 .ConditionTrue {
250
261
if condition .Type == configv1 .OperatorAvailable {
@@ -256,6 +267,16 @@ func testUpgradeOperatorStateTransitions(events monitorapi.Intervals, clientConf
256
267
}
257
268
}
258
269
270
+ if isTwoNode {
271
+ switch operator {
272
+ case "csi-snapshot-controller" :
273
+ if condition .Type == configv1 .OperatorAvailable && condition .Status == configv1 .ConditionFalse &&
274
+ strings .Contains (condition .Message , `Waiting for Deployment` ) {
275
+ return "csi snapshot controller is allowed to have Available=False due to CSI webhook test on two node" , nil
276
+ }
277
+ }
278
+ }
279
+
259
280
withinUpgradeWindowBuffer := isInUpgradeWindow (upgradeWindows , eventInterval ) && eventInterval .To .Sub (eventInterval .From ) < 10 * time .Minute
260
281
if ! withinUpgradeWindowBuffer {
261
282
switch operator {
0 commit comments