mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-15 06:43:54 +00:00
dra scheduler: fix re-allocation of claim with structured parameters
The code was incorrectly checking for a controller, but only the boolean is set for allocated claims. As a result, deallocation was requested from a non-existent control plane controller. While at it, let's also clear the driver name. It's not needed when the claim is deallocated.
This commit is contained in:
parent
cf8fffae72
commit
95136db063
@ -1209,7 +1209,7 @@ func (pl *dynamicResources) PostFilter(ctx context.Context, cs *framework.CycleS
|
||||
// Then we can simply clear the allocation. Once the
|
||||
// claim informer catches up, the controllers will
|
||||
// be notified about this change.
|
||||
clearAllocation := state.informationsForClaim[index].controller != nil
|
||||
clearAllocation := state.informationsForClaim[index].structuredParameters
|
||||
|
||||
// Before we tell a driver to deallocate a claim, we
|
||||
// have to stop telling it to allocate. Otherwise,
|
||||
@ -1228,6 +1228,7 @@ func (pl *dynamicResources) PostFilter(ctx context.Context, cs *framework.CycleS
|
||||
claim := claim.DeepCopy()
|
||||
claim.Status.ReservedFor = nil
|
||||
if clearAllocation {
|
||||
claim.Status.DriverName = ""
|
||||
claim.Status.Allocation = nil
|
||||
} else {
|
||||
claim.Status.DeallocationRequested = true
|
||||
|
Loading…
Reference in New Issue
Block a user