Commit e0f15bf5 authored by tianshapjq's avatar tianshapjq

Len() is already int

parent 7726877a
...@@ -560,7 +560,7 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi ...@@ -560,7 +560,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]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment