From 0a74470d38aa2a3dbdf8364ca6eaf69e9fe32c51 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Wed, 24 Jul 2024 12:54:45 +0200 Subject: [PATCH] Don't mark processes as errNotEnoughResourcesForDeployment when budget has been used up --- cluster/leader_synchronize.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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...)