Merge pull request #110827 from Abirdcfly/simple2

cleanup:use append other than for loop
This commit is contained in:
Kubernetes Prow Robot 2022-06-28 19:58:15 -07:00 committed by GitHub
commit 7f920da442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -225,9 +225,7 @@ func (r *reconciler) reconcileByAddressType(service *corev1.Service, pods []*cor
// the corresponding endpoint slices for deletion.
for portMap, existingSlices := range existingSlicesByPortMap {
if _, ok := desiredEndpointsByPortMap[portMap]; !ok {
for _, existingSlice := range existingSlices {
slicesToDelete = append(slicesToDelete, existingSlice)
}
slicesToDelete = append(slicesToDelete, existingSlices...)
}
}