Skip to content

Commit 8362f51

Browse files
authored
Merge pull request kubernetes#124876 from danwinship/kind-loadbalancers-1
e2e-kind-cloud-provider-loadbalancer fixes, part 1
2 parents 466b10f + 85d5b4b commit 8362f51

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

test/e2e/network/loadbalancer.go

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ var _ = common.SIGDescribe("LoadBalancers", feature.LoadBalancer, func() {
387387
err = udpJig.Scale(ctx, 0)
388388
framework.ExpectNoError(err)
389389

390-
ginkgo.By("looking for ICMP REJECT on the UDP service's LoadBalancer")
391-
testRejectedUDP(ctx, udpIngressIP, svcPort, loadBalancerCreateTimeout)
390+
ginkgo.By("checking that the UDP service's LoadBalancer is not reachable")
391+
testNotReachableUDP(ctx, udpIngressIP, svcPort, loadBalancerCreateTimeout)
392392

393393
ginkgo.By("Scaling the pods to 1")
394394
err = udpJig.Scale(ctx, 1)
@@ -927,11 +927,6 @@ var _ = common.SIGDescribe("LoadBalancers", feature.LoadBalancer, func() {
927927
})
928928

929929
var _ = common.SIGDescribe("LoadBalancers ExternalTrafficPolicy: Local", feature.LoadBalancer, framework.WithSlow(), func() {
930-
// FIXME: What are the expected semantics of requesting an
931-
// "ExternalTrafficPolicy: Local" service from a cloud provider that does not
932-
// support that? What are the expected semantics of "ExternalTrafficPolicy: Local"
933-
// on `IPMode: Proxy`-type LoadBalancers?
934-
935930
f := framework.NewDefaultFramework("esipp")
936931
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
937932
var loadBalancerCreateTimeout time.Duration
@@ -987,6 +982,14 @@ var _ = common.SIGDescribe("LoadBalancers ExternalTrafficPolicy: Local", feature
987982
framework.ExpectNoError(err)
988983
})
989984

985+
// FIXME: figure out the actual expected semantics for
986+
// "ExternalTrafficPolicy: Local" + "IPMode: Proxy".
987+
// https://issues.k8s.io/123714
988+
ingress := &svc.Status.LoadBalancer.Ingress[0]
989+
if ingress.IP == "" || (ingress.IPMode != nil && *ingress.IPMode == v1.LoadBalancerIPModeProxy) {
990+
e2eskipper.Skipf("LoadBalancer uses 'Proxy' IPMode")
991+
}
992+
990993
svcTCPPort := int(svc.Spec.Ports[0].Port)
991994
ingressIP := e2eservice.GetIngressPoint(&svc.Status.LoadBalancer.Ingress[0])
992995

@@ -1133,6 +1136,14 @@ var _ = common.SIGDescribe("LoadBalancers ExternalTrafficPolicy: Local", feature
11331136
framework.ExpectNoError(err)
11341137
})
11351138

1139+
// FIXME: figure out the actual expected semantics for
1140+
// "ExternalTrafficPolicy: Local" + "IPMode: Proxy".
1141+
// https://issues.k8s.io/123714
1142+
ingress := &svc.Status.LoadBalancer.Ingress[0]
1143+
if ingress.IP == "" || (ingress.IPMode != nil && *ingress.IPMode == v1.LoadBalancerIPModeProxy) {
1144+
e2eskipper.Skipf("LoadBalancer uses 'Proxy' IPMode")
1145+
}
1146+
11361147
ingressIP := e2eservice.GetIngressPoint(&svc.Status.LoadBalancer.Ingress[0])
11371148
port := strconv.Itoa(int(svc.Spec.Ports[0].Port))
11381149
ipPort := net.JoinHostPort(ingressIP, port)

test/e2e/network/service.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -606,20 +606,6 @@ func testNotReachableUDP(ctx context.Context, host string, port int, timeout tim
606606
}
607607
}
608608

609-
// testRejectedUDP tests that the given host rejects a UDP request on the given port.
610-
func testRejectedUDP(ctx context.Context, host string, port int, timeout time.Duration) {
611-
pollfn := func(ctx context.Context) (bool, error) {
612-
result := pokeUDP(host, port, "echo hello", &UDPPokeParams{Timeout: 3 * time.Second})
613-
if result.Status == UDPRefused {
614-
return true, nil
615-
}
616-
return false, nil // caller can retry
617-
}
618-
if err := wait.PollUntilContextTimeout(ctx, framework.Poll, timeout, true, pollfn); err != nil {
619-
framework.Failf("UDP service %v:%v not rejected: %v", host, port, err)
620-
}
621-
}
622-
623609
// TestHTTPHealthCheckNodePort tests a HTTP connection by the given request to the given host and port.
624610
func TestHTTPHealthCheckNodePort(ctx context.Context, host string, port int, request string, timeout time.Duration, expectSucceed bool, threshold int) error {
625611
count := 0

0 commit comments

Comments
 (0)