Skip to content

Commit

Permalink
optimize workloadspread when suitable subset maxReplicas is niil
Browse files Browse the repository at this point in the history
Signed-off-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
  • Loading branch information
mingzhou.swx committed Aug 26, 2022
1 parent bdd3efb commit cea6cb5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/util/workloadspread/workloadspread.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,10 @@ func (h *Handler) updateSubsetForPod(ws *appsv1alpha1.WorkloadSpread,
ws.Namespace, ws.Name, pod.Name)
return false, nil, ""
}
// no need to update WorkloadSpread status if MaxReplicas == nil
if suitableSubset.MissingReplicas == -1 {
return false, suitableSubset, ""
}
if suitableSubset.CreatingPods == nil {
suitableSubset.CreatingPods = map[string]metav1.Time{}
}
Expand Down

0 comments on commit cea6cb5

Please sign in to comment.