Merge pull request #108232 from qmloong/qmloong/chore

fix: remove the redundant count variable
This commit is contained in:
Kubernetes Prow Robot 2022-06-01 10:53:40 -07:00 committed by GitHub
commit 22fda4e7ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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