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)