diff --git a/pkg/controller/endpointslice/reconciler.go b/pkg/controller/endpointslice/reconciler.go index 9b91566f853..f8f4dbeb241 100644 --- a/pkg/controller/endpointslice/reconciler.go +++ b/pkg/controller/endpointslice/reconciler.go @@ -150,7 +150,6 @@ func (r *reconciler) reconcileByAddressType(service *corev1.Service, pods []*cor // Build data structures for desired state. desiredMetaByPortMap := map[endpointutil.PortMapKey]*endpointMeta{} desiredEndpointsByPortMap := map[endpointutil.PortMapKey]endpointsliceutil.EndpointSet{} - numDesiredEndpoints := 0 for _, pod := range pods { includeTerminating := service.Spec.PublishNotReadyAddresses || utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceTerminatingCondition) @@ -178,7 +177,6 @@ func (r *reconciler) reconcileByAddressType(service *corev1.Service, pods []*cor endpoint := podToEndpoint(pod, node, service, addressType) if len(endpoint.Addresses) > 0 { desiredEndpointsByPortMap[epHash].Insert(&endpoint) - numDesiredEndpoints++ } }