From 14b76c7cd6a84ae7732f4309e830ae41990af52b Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Wed, 2 Oct 2024 11:23:53 +0100 Subject: [PATCH] Fix Bug with getCapacityForPool (#3979) Signed-off-by: Chris Martin --- internal/scheduler/scheduling/scheduling_algo.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/scheduler/scheduling/scheduling_algo.go b/internal/scheduler/scheduling/scheduling_algo.go index d5bc943a3bd..535fbe3056b 100644 --- a/internal/scheduler/scheduling/scheduling_algo.go +++ b/internal/scheduler/scheduling/scheduling_algo.go @@ -275,7 +275,9 @@ func (l *FairSchedulingAlgo) getCapacityForPool(pool string, executors []*schedu totalCapacity := schedulerobjects.ResourceList{} for _, executor := range executors { for _, node := range executor.Nodes { - totalCapacity.Add(node.TotalResources) + if node.Pool == pool { + totalCapacity.Add(node.TotalResources) + } } } totalCapacity.Add(l.floatingResourceTypes.GetTotalAvailableForPool(pool))