From 21a88a8cc5bc9a3e5a3cf651d8c032d48ef56eab Mon Sep 17 00:00:00 2001 From: Andrew Stucki Date: Mon, 11 Apr 2022 10:09:43 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Nitya Dhanushkodi --- control-plane/connect-inject/endpoints_controller.go | 2 +- control-plane/connect-inject/endpoints_controller_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/control-plane/connect-inject/endpoints_controller.go b/control-plane/connect-inject/endpoints_controller.go index aa55663b8a..4ad4f48e95 100644 --- a/control-plane/connect-inject/endpoints_controller.go +++ b/control-plane/connect-inject/endpoints_controller.go @@ -178,7 +178,7 @@ func (r *EndpointsController) Reconcile(ctx context.Context, req ctrl.Request) ( serviceName, ok := pod.Annotations[annotationKubernetesService] if ok && serviceEndpoints.Name != serviceName { r.Log.Info("ignoring endpoint because it doesn't match explicit service annotation", "name", serviceEndpoints.Name, "ns", serviceEndpoints.Namespace) - // deregistration happens later because we don't add this pod to the endpointAddressMap + // deregistration for service instances that don't match the annotation happens later because we don't add this pod to the endpointAddressMap. continue } diff --git a/control-plane/connect-inject/endpoints_controller_test.go b/control-plane/connect-inject/endpoints_controller_test.go index da198afa31..fbc3c5f3b6 100644 --- a/control-plane/connect-inject/endpoints_controller_test.go +++ b/control-plane/connect-inject/endpoints_controller_test.go @@ -3491,7 +3491,7 @@ func TestReconcile_podSpecifiesExplicitService(t *testing.T) { // Run the reconcile again with the service we want to register. serviceName = endpoint.Name - namespacedName = types.NamespacedName{Namespace: badEndpoint.Namespace, Name: serviceName} + namespacedName = types.NamespacedName{Namespace: endpoint.Namespace, Name: serviceName} resp, err = ep.Reconcile(context.Background(), ctrl.Request{NamespacedName: namespacedName}) require.NoError(t, err) require.False(t, resp.Requeue)