Skip to content

Commit

Permalink
Merge pull request #103050 from ardaguclu/fix-node-auth-dualstack
Browse files Browse the repository at this point in the history
Fix NodeAuthenticator tests in dual stack
  • Loading branch information
k8s-ci-robot committed Jun 23, 2021
2 parents e120459 + 676958c commit 13e7cba
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/e2e/auth/node_authn.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ var _ = SIGDescribe("[Feature:NodeAuthenticator]", func() {
ginkgo.BeforeEach(func() {
ns = f.Namespace.Name

nodeList, err := f.ClientSet.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{})
framework.ExpectNoError(err, "failed to list nodes in namespace: %s", ns)
framework.ExpectNotEqual(len(nodeList.Items), 0)

pickedNode := nodeList.Items[0]
nodeIPs = e2enode.GetAddresses(&pickedNode, v1.NodeExternalIP)
// The pods running in the cluster can see the internal addresses.
nodeIPs = append(nodeIPs, e2enode.GetAddresses(&pickedNode, v1.NodeInternalIP)...)
nodes, err := e2enode.GetBoundedReadySchedulableNodes(f.ClientSet, 1)
framework.ExpectNoError(err)

family := v1.IPv4Protocol
if framework.TestContext.ClusterIsIPv6() {
family = v1.IPv6Protocol
}

nodeIPs := e2enode.GetAddressesByTypeAndFamily(&nodes.Items[0], v1.NodeInternalIP, family)
framework.ExpectNotEqual(len(nodeIPs), 0)

// make sure ServiceAccount admission controller is enabled, so secret generation on SA creation works
saName := "default"
Expand Down

0 comments on commit 13e7cba

Please sign in to comment.