Skip to content

Commit

Permalink
fix: more reasonable desired replicas calculation (#359)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Wang <[email protected]>
  • Loading branch information
whynowy committed Sep 20, 2021
1 parent 98149b2 commit 2176e72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion manager/controllers/scaling/scaling.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ func GetDesiredReplicas(step dfv1.Step) (int, error) {
desiredReplicas := currentReplicas
pending, ok := GetPending(step)
if !ok { // Haven't got pending data
return 1, nil
if currentReplicas > 0 {
return currentReplicas, nil
} else {
return 1, nil
}
}
lastPending, ok := GetLastPending(step)
if !ok { // Haven't got last-pending data
Expand Down

0 comments on commit 2176e72

Please sign in to comment.