mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #58122 from tianshapjq/nit-int-is-enough
Len() is already int
This commit is contained in:
commit
03b434c9d4
@ -612,7 +612,7 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi
|
|||||||
devicesInUse := m.allocatedDevices[resource]
|
devicesInUse := m.allocatedDevices[resource]
|
||||||
// Gets a list of available devices.
|
// Gets a list of available devices.
|
||||||
available := m.healthyDevices[resource].Difference(devicesInUse)
|
available := m.healthyDevices[resource].Difference(devicesInUse)
|
||||||
if int(available.Len()) < needed {
|
if available.Len() < needed {
|
||||||
return nil, fmt.Errorf("requested number of devices unavailable for %s. Requested: %d, Available: %d", resource, needed, available.Len())
|
return nil, fmt.Errorf("requested number of devices unavailable for %s. Requested: %d, Available: %d", resource, needed, available.Len())
|
||||||
}
|
}
|
||||||
allocated := available.UnsortedList()[:needed]
|
allocated := available.UnsortedList()[:needed]
|
||||||
|
Loading…
Reference in New Issue
Block a user