From b0d4a8cd6df5b8ffa85829cd1efb8a516ed5d04d Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 20 Dec 2023 09:04:01 +0100 Subject: [PATCH] dra scheduler: fix incorrect tracking of claim candidates for reallocation When dealing with unschedulable pods, the intent was to deallocate only claims which are allocated and use delayed allocation. That if check wasn't handled correctly, causing also claims with immediate allocation to be considered as candidates. Found during code reading, probably has never occurred in practice yet. --- .../framework/plugins/dynamicresources/dynamicresources.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go b/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go index 7a9a91312b4..e4025ab290c 100644 --- a/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go +++ b/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go @@ -754,7 +754,7 @@ func (pl *dynamicResources) Filter(ctx context.Context, cs *framework.CycleState // would just get allocated again for a random node, // which is unlikely to help the pod. if claim.Spec.AllocationMode == resourcev1alpha2.AllocationModeWaitForFirstConsumer { - state.unavailableClaims.Insert(unavailableClaims...) + state.unavailableClaims.Insert(index) } } return statusUnschedulable(logger, "resourceclaim not available on the node", "pod", klog.KObj(pod))