From 683f7f43af0f135bdcbcaca26678d918efe532c7 Mon Sep 17 00:00:00 2001 From: Aaron U'Ren Date: Sun, 7 Jan 2024 16:01:43 -0600 Subject: [PATCH] e2e/endpointslice: add ready conditions Add ready conditions to the Endpoints of the self-generated EndpointSlice tests so that the readiness is not ambiguous and it will work across CNIs that filter for ready endpoints. --- test/e2e/network/endpointslice.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/e2e/network/endpointslice.go b/test/e2e/network/endpointslice.go index 316f60a2c6a..479c3568874 100644 --- a/test/e2e/network/endpointslice.go +++ b/test/e2e/network/endpointslice.go @@ -583,6 +583,7 @@ var _ = common.SIGDescribe("EndpointSlice", func() { // create custom endpoint slices tcpProtocol := v1.ProtocolTCP + readyCondTrue := true epsTemplate := &discoveryv1.EndpointSlice{ ObjectMeta: metav1.ObjectMeta{GenerateName: "e2e-custom-slice", Labels: map[string]string{ @@ -591,7 +592,10 @@ var _ = common.SIGDescribe("EndpointSlice", func() { }}, AddressType: addressType, Endpoints: []discoveryv1.Endpoint{ - {Addresses: []string{pod.Status.PodIP}}, + { + Addresses: []string{pod.Status.PodIP}, + Conditions: discoveryv1.EndpointConditions{Ready: &readyCondTrue}, + }, }, } @@ -684,6 +688,7 @@ var _ = common.SIGDescribe("EndpointSlice", func() { // create custom endpoint slices tcpProtocol := v1.ProtocolTCP + readyCondTrue := true epsTemplate := &discoveryv1.EndpointSlice{ ObjectMeta: metav1.ObjectMeta{GenerateName: "e2e-custom-slice", Labels: map[string]string{ @@ -696,7 +701,10 @@ var _ = common.SIGDescribe("EndpointSlice", func() { ginkgo.By("creating") eps1 := epsTemplate.DeepCopy() eps1.Endpoints = []discoveryv1.Endpoint{ - {Addresses: []string{pod1.Status.PodIP}}, + { + Addresses: []string{pod1.Status.PodIP}, + Conditions: discoveryv1.EndpointConditions{Ready: &readyCondTrue}, + }, } eps1.Ports = []discoveryv1.EndpointPort{{ Name: pointer.String("port80"), @@ -708,7 +716,10 @@ var _ = common.SIGDescribe("EndpointSlice", func() { framework.ExpectNoError(err) eps2 := epsTemplate.DeepCopy() eps2.Endpoints = []discoveryv1.Endpoint{ - {Addresses: []string{pod2.Status.PodIP}}, + { + Addresses: []string{pod2.Status.PodIP}, + Conditions: discoveryv1.EndpointConditions{Ready: &readyCondTrue}, + }, } eps2.Ports = []discoveryv1.EndpointPort{{ Name: pointer.String("port81"),