diff --git a/test/integration/endpointslice/endpointslicemirroring_test.go b/test/integration/endpointslice/endpointslicemirroring_test.go index cf9df0e42e5..76367146d20 100644 --- a/test/integration/endpointslice/endpointslicemirroring_test.go +++ b/test/integration/endpointslice/endpointslicemirroring_test.go @@ -84,7 +84,7 @@ func TestEndpointSliceMirroring(t *testing.T) { testCases := []struct { testName string service *corev1.Service - endpoints *corev1.Endpoints + customEndpoints *corev1.Endpoints expectEndpointSlice bool expectEndpointSliceManagedBy string }{{ @@ -102,11 +102,6 @@ func TestEndpointSliceMirroring(t *testing.T) { }, }, }, - endpoints: &corev1.Endpoints{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-123", - }, - }, expectEndpointSlice: true, expectEndpointSliceManagedBy: "endpointslice-controller.k8s.io", }, { @@ -121,7 +116,7 @@ func TestEndpointSliceMirroring(t *testing.T) { }}, }, }, - endpoints: &corev1.Endpoints{ + customEndpoints: &corev1.Endpoints{ ObjectMeta: metav1.ObjectMeta{ Name: "test-123", }, @@ -151,13 +146,13 @@ func TestEndpointSliceMirroring(t *testing.T) { }, }, }, - endpoints: nil, + customEndpoints: nil, expectEndpointSlice: true, expectEndpointSliceManagedBy: "endpointslice-controller.k8s.io", }, { testName: "Endpoints without Service", service: nil, - endpoints: &corev1.Endpoints{ + customEndpoints: &corev1.Endpoints{ ObjectMeta: metav1.ObjectMeta{ Name: "test-123", }, @@ -180,10 +175,10 @@ func TestEndpointSliceMirroring(t *testing.T) { } } - if tc.endpoints != nil { - resourceName = tc.endpoints.Name - tc.endpoints.Namespace = ns.Name - _, err = client.CoreV1().Endpoints(ns.Name).Create(context.TODO(), tc.endpoints, metav1.CreateOptions{}) + if tc.customEndpoints != nil { + resourceName = tc.customEndpoints.Name + tc.customEndpoints.Namespace = ns.Name + _, err = client.CoreV1().Endpoints(ns.Name).Create(context.TODO(), tc.customEndpoints, metav1.CreateOptions{}) if err != nil { t.Fatalf("Error creating endpoints: %v", err) }