mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
nodeport tests: node addresses must match the service IP family
This commit is contained in:
parent
f7d2ecdc3e
commit
1721be087d
@ -2497,9 +2497,13 @@ func execAffinityTestForSessionAffinityTimeout(f *framework.Framework, cs client
|
|||||||
if serviceType == v1.ServiceTypeNodePort {
|
if serviceType == v1.ServiceTypeNodePort {
|
||||||
nodes, err := e2enode.GetReadySchedulableNodes(cs)
|
nodes, err := e2enode.GetReadySchedulableNodes(cs)
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
addrs := e2enode.CollectAddresses(nodes, v1.NodeInternalIP)
|
// The node addresses must have the same IP family as the ClusterIP
|
||||||
gomega.Expect(len(addrs)).To(gomega.BeNumerically(">", 0), "ginkgo.Failed to get Node internal IP")
|
family := v1.IPv4Protocol
|
||||||
svcIP = addrs[0]
|
if netutils.IsIPv6String(svc.Spec.ClusterIP) {
|
||||||
|
family = v1.IPv6Protocol
|
||||||
|
}
|
||||||
|
svcIP = e2enode.FirstAddressByTypeAndFamily(nodes, v1.NodeInternalIP, family)
|
||||||
|
framework.ExpectNotEqual(svcIP, "", "failed to get Node internal IP for family: %s", family)
|
||||||
servicePort = int(svc.Spec.Ports[0].NodePort)
|
servicePort = int(svc.Spec.Ports[0].NodePort)
|
||||||
} else {
|
} else {
|
||||||
svcIP = svc.Spec.ClusterIP
|
svcIP = svc.Spec.ClusterIP
|
||||||
@ -2582,7 +2586,7 @@ func execAffinityTestForNonLBServiceWithOptionalTransition(f *framework.Framewor
|
|||||||
family = v1.IPv6Protocol
|
family = v1.IPv6Protocol
|
||||||
}
|
}
|
||||||
svcIP = e2enode.FirstAddressByTypeAndFamily(nodes, v1.NodeInternalIP, family)
|
svcIP = e2enode.FirstAddressByTypeAndFamily(nodes, v1.NodeInternalIP, family)
|
||||||
gomega.Expect(len(svcIP)).To(gomega.BeNumerically(">", 0), "ginkgo.Failed to get Node internal IP")
|
framework.ExpectNotEqual(svcIP, "", "failed to get Node internal IP for family: %s", family)
|
||||||
servicePort = int(svc.Spec.Ports[0].NodePort)
|
servicePort = int(svc.Spec.Ports[0].NodePort)
|
||||||
} else {
|
} else {
|
||||||
svcIP = svc.Spec.ClusterIP
|
svcIP = svc.Spec.ClusterIP
|
||||||
|
Loading…
Reference in New Issue
Block a user