Skip to content

Commit

Permalink
refactor getPodsToDelete comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdsteelRail committed Oct 15, 2024
1 parent 6cbce53 commit b21a281
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controllers/collaset/synccontrol/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ func getPodsToDelete(filteredPods []*collasetutils.PodWrapper, replaceMapping ma
}

if replacePairPod, exist := replaceMapping[pod.Name]; exist && replacePairPod != nil {
// don't scaleIn new pod until origin pod is deleted, if you want to delete new pod, please delete it by label
// don't selective scaleIn newPod (and its originPod) until replace finished
if replacePairPod.ToDelete {
continue
}
// new pod not service available, just scaleIn it
// when scaleIn origin Pod, newPod should be deleted if not service available
if _, serviceAvailable := replacePairPod.Labels[appsv1alpha1.PodServiceAvailableLabel]; !serviceAvailable {
needDeletePods = append(needDeletePods, replacePairPod)
}
Expand Down

0 comments on commit b21a281

Please sign in to comment.