fix: remove the redundant count variable

This commit is contained in:
menglong.qi 2022-02-21 00:32:21 +08:00
parent d5263feb03
commit a1269198ec

View File

@ -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++
}
}