diff --git a/cluster/leader_synchronize.go b/cluster/leader_synchronize.go index a043d823..b597d78e 100644 --- a/cluster/leader_synchronize.go +++ b/cluster/leader_synchronize.go @@ -361,7 +361,7 @@ func synchronize(wish map[string]string, want []store.Process, have []node.Proce } } - if len(nodeid) != 0 && opBudget > 0 { + if len(nodeid) != 0 { opStackAdd = append(opStackAdd, processOpAdd{ nodeid: nodeid, config: wantP.Config, @@ -383,6 +383,10 @@ func synchronize(wish map[string]string, want []store.Process, have []node.Proce err: errNotEnoughResourcesForDeployment, }) } + + if opBudget <= 0 { + break + } } opStack = append(opStack, opStackDelete...)