DRA scheduler: code cleanup

Comment fix and removal of `skippedUnknownDevice`. That field was originally
meant to somehow influence how a failure to allocate gets reported, but in the
end that distinction was not implemented.
This commit is contained in:
Patrick Ohly 2024-09-23 17:48:01 +02:00
parent 6dffee6534
commit c1ec1dce75

View File

@ -68,7 +68,7 @@ func NewAllocator(ctx context.Context,
}, nil }, nil
} }
// ClaimsToAllocate returns the claims that the allocated was created for. // ClaimsToAllocate returns the claims that the allocator was created for.
func (a *Allocator) ClaimsToAllocate() []*resourceapi.ResourceClaim { func (a *Allocator) ClaimsToAllocate() []*resourceapi.ResourceClaim {
return a.claimsToAllocate return a.claimsToAllocate
} }
@ -354,7 +354,6 @@ type allocator struct {
constraints [][]constraint // one list of constraints per claim constraints [][]constraint // one list of constraints per claim
requestData map[requestIndices]requestData // one entry per request requestData map[requestIndices]requestData // one entry per request
allocated map[DeviceID]bool allocated map[DeviceID]bool
skippedUnknownDevice bool
result []*resourceapi.AllocationResult result []*resourceapi.AllocationResult
} }
@ -620,9 +619,6 @@ func (alloc *allocator) isSelectable(r requestIndices, slice *resourceapi.Resour
device := slice.Spec.Devices[deviceIndex].Basic device := slice.Spec.Devices[deviceIndex].Basic
if device == nil { if device == nil {
// Must be some future, unknown device type. We cannot select it. // Must be some future, unknown device type. We cannot select it.
// If we don't find anything else, then this will get reported
// in the final result, so remember that we skipped some device.
alloc.skippedUnknownDevice = true
return false, nil return false, nil
} }