File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,10 @@ var _ = Describe("FAR E2e", func() {
108108 if availableWorkerNodes == nil {
109109 availableWorkerNodes = getReadyWorkerNodes ()
110110 }
111+ if len (availableWorkerNodes .Items ) < 1 {
112+ Fail ("There isn't an available (and Ready) worker node in the cluster" )
113+ }
114+
111115 selectedNode = pickRemediatedNode (availableWorkerNodes )
112116 nodeName = selectedNode .Name
113117 printNodeDetails (selectedNode , nodeIdentifierPrefix , testNodeParam )
@@ -269,18 +273,12 @@ func getReadyWorkerNodes() *corev1.NodeList {
269273 }
270274 }
271275 }
272- if len (readyWorkerNodes .Items ) < 1 {
273- Fail ("There isn't an available (and ready) worker node in the cluster" )
274- }
275276 return readyWorkerNodes
276277}
277278
278279// pickRemediatedNode randomly returns a next remediated node from the current available nodes,
279280// and then the node is removed from the list of available nodes
280281func pickRemediatedNode (availableNodes * corev1.NodeList ) * corev1.Node {
281- if len (availableNodes .Items ) < 1 {
282- Fail ("There isn't an available (and ready) worker node in the cluster" )
283- }
284282 // Generate a random seed based on the current time
285283 r := rand .New (rand .NewSource (time .Now ().UnixNano ()))
286284 // Randomly select a worker node
You can’t perform that action at this time.
0 commit comments