mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #113021 from rphillips/fixes/112936
kubelet: fix nil crash in allocateRemainingFrom
This commit is contained in:
commit
1a41cb8985
@ -564,16 +564,16 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocates from reusableDevices list first.
|
|
||||||
if allocateRemainingFrom(reusableDevices) {
|
|
||||||
return allocated, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Needs to allocate additional devices.
|
// Needs to allocate additional devices.
|
||||||
if m.allocatedDevices[resource] == nil {
|
if m.allocatedDevices[resource] == nil {
|
||||||
m.allocatedDevices[resource] = sets.NewString()
|
m.allocatedDevices[resource] = sets.NewString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allocates from reusableDevices list first.
|
||||||
|
if allocateRemainingFrom(reusableDevices) {
|
||||||
|
return allocated, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Gets Devices in use.
|
// Gets Devices in use.
|
||||||
devicesInUse := m.allocatedDevices[resource]
|
devicesInUse := m.allocatedDevices[resource]
|
||||||
// Gets Available devices.
|
// Gets Available devices.
|
||||||
|
Loading…
Reference in New Issue
Block a user