code cleanup: append slice without check

This commit is contained in:
BinacsLee 2021-04-22 18:29:30 +08:00
parent 82d8d08c78
commit d7a4ed9c65

View File

@ -199,15 +199,9 @@ func (r *reconciler) reconcileByAddressType(service *corev1.Service, pods []*cor
Slices: len(existingSlicesByPortMap[portMap]) + len(pmSlicesToCreate) - len(pmSlicesToDelete), Slices: len(existingSlicesByPortMap[portMap]) + len(pmSlicesToCreate) - len(pmSlicesToDelete),
}) })
if len(pmSlicesToCreate) > 0 { slicesToCreate = append(slicesToCreate, pmSlicesToCreate...)
slicesToCreate = append(slicesToCreate, pmSlicesToCreate...) slicesToUpdate = append(slicesToUpdate, pmSlicesToUpdate...)
} slicesToDelete = append(slicesToDelete, pmSlicesToDelete...)
if len(pmSlicesToUpdate) > 0 {
slicesToUpdate = append(slicesToUpdate, pmSlicesToUpdate...)
}
if len(pmSlicesToDelete) > 0 {
slicesToDelete = append(slicesToDelete, pmSlicesToDelete...)
}
} }
// If there are unique sets of ports that are no longer desired, mark // If there are unique sets of ports that are no longer desired, mark