Update scheduler/reconcile.go

Co-authored-by: Chris Baker <1675087+cgbaker@users.noreply.github.com>
This commit is contained in:
Mahmood Ali
2020-08-25 17:33:15 -04:00
parent 3a28b85b8a
commit f075bcc811

View File

@@ -426,7 +426,8 @@ func (a *allocReconciler) computeGroup(group string, all allocSet) bool {
// desired means we need to create canaries
strategy := tg.Update
canariesPromoted := dstate != nil && dstate.Promoted
requireCanary := (len(destructive) != 0 || (len(untainted) == 0 && len(migrate)+len(lost) != 0)) &&
replaceAllAllocs := len(untainted) == 0 && len(migrate)+len(lost) != 0
requireCanary := (len(destructive) != 0 || replaceAllAllocs) &&
strategy != nil && len(canaries) < strategy.Canary && !canariesPromoted
if requireCanary {
dstate.DesiredCanaries = strategy.Canary