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.
This commit is contained in:
Patrick Ohly 2023-12-20 09:04:01 +01:00
parent d647d19f6a
commit b0d4a8cd6d

View File

@ -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))