Skip to content

Commit

Permalink
test: avoid tainted nodes when selecting nodes for test
Browse files Browse the repository at this point in the history
  • Loading branch information
tzneal authored and jdn5126 committed Jan 25, 2023
1 parent dc42246 commit fa21b02
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions test/integration/cni/pod_networking_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,21 @@ var _ = BeforeSuite(func() {

By("verifying more than 1 nodes are present for the test")
Expect(len(nodes.Items)).Should(BeNumerically(">", 1))

// Set the primary and secondary node for testing
primaryNode = nodes.Items[0]
secondaryNode = nodes.Items[1]

for i := range nodes.Items {
n := nodes.Items[i]
if len(n.Spec.Taints) == 0 {
if primaryNode.Name == "" {
primaryNode = n
} else {
secondaryNode = n
break
}
}
}
Expect(primaryNode.Name).To(Not(HaveLen(0)), "expected to find a non-tainted node")
Expect(secondaryNode.Name).To(Not(HaveLen(0)), "expected to find a non-tainted secondary node")

// Get the node security group
instanceID := k8sUtils.GetInstanceIDFromNode(primaryNode)
Expand Down

0 comments on commit fa21b02

Please sign in to comment.