Skip to content

Commit

Permalink
Do not skip "master" nodes for non-gw nodes search
Browse files Browse the repository at this point in the history
The "FindNonGatewayNodes" function search for the nodes of the cluster
that do not hold the gateway label.
- Filter the nodes by missing the gateway label instead of comparing it
  to "false"

- A change between k8s version 1.23 and 1.25 is the removal of "master"
  label from the control-plane nodes.
  In order to not rely on this label, which existance changes between
  the versions, do not filter the nodes by it.

Signed-off-by: Maxim Babushkin <[email protected]>
  • Loading branch information
MaxBab authored and tpantelis committed Dec 7, 2022
1 parent 3cc79ee commit 4c0a608
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions test/e2e/framework/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ func FindGatewayNodes(cluster ClusterIndex) []v1.Node {
func FindNonGatewayNodes(cluster ClusterIndex) []v1.Node {
nodes, err := KubeClients[cluster].CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{
LabelSelector: labels.NewSelector().Add(
// Ignore the control plane node labeled as master as it doesn't allow scheduling of pods
NewRequirement("node-role.kubernetes.io/master", selection.DoesNotExist, []string{}),
NewRequirement(GatewayLabel, selection.NotEquals, []string{"true"})).String(),
})
Expect(err).NotTo(HaveOccurred())
Expand Down

0 comments on commit 4c0a608

Please sign in to comment.