mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
e2e log info on nodeport allocation failures
This commit is contained in:
parent
0798325ba1
commit
fdebfb4485
@ -4118,6 +4118,22 @@ var _ = common.SIGDescribe("Services", func() {
|
|||||||
// Request the same healthCheckNodePort as before, to test the user-requested allocation path
|
// Request the same healthCheckNodePort as before, to test the user-requested allocation path
|
||||||
svc.Spec.HealthCheckNodePort = oldHealthCheckNodePort
|
svc.Spec.HealthCheckNodePort = oldHealthCheckNodePort
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
// We added a global static nodeport allocator to synchronize across tests and avoid other tests stealing the NodePort of this test and make it flake.
|
||||||
|
// Log the offending Service so we identify easily the problematic test.
|
||||||
|
// Dump all the IPs and look for the ones we want.
|
||||||
|
list, _ := cs.CoreV1().Services(metav1.NamespaceAll).List(ctx, metav1.ListOptions{})
|
||||||
|
for _, svc := range list.Items {
|
||||||
|
if svc.Spec.HealthCheckNodePort == oldHealthCheckNodePort {
|
||||||
|
framework.Failf("Service %#v stole NodePort from current test, please ensure that test is using the Static NodePort Allocator https://github.com/kubernetes/kubernetes/pull/127153 : %v", svc, err)
|
||||||
|
}
|
||||||
|
for _, port := range svc.Spec.Ports {
|
||||||
|
if port.NodePort == oldHealthCheckNodePort {
|
||||||
|
framework.Failf("Service %#v stole NodePort from current test, please ensure that test is using the Static NodePort Allocator https://github.com/kubernetes/kubernetes/pull/127153 : %v", svc, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
framework.ExpectNoError(err, "updating ExternalTrafficPolicy and HealthCheckNodePort")
|
framework.ExpectNoError(err, "updating ExternalTrafficPolicy and HealthCheckNodePort")
|
||||||
deadline = time.Now().Add(e2eservice.KubeProxyEndpointLagTimeout)
|
deadline = time.Now().Add(e2eservice.KubeProxyEndpointLagTimeout)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user