mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
fix kubelet npe on device plugin return zero container
Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
This commit is contained in:
parent
4e0a60a44c
commit
b1bdd043c4
@ -664,6 +664,10 @@ func (m *ManagerImpl) allocateContainerResources(pod *v1.Pod, container *v1.Cont
|
||||
return err
|
||||
}
|
||||
|
||||
if len(resp.ContainerResponses) == 0 {
|
||||
return fmt.Errorf("No containers return in allocation response %v", resp)
|
||||
}
|
||||
|
||||
// Update internal cached podDevices state.
|
||||
m.mutex.Lock()
|
||||
m.podDevices.insert(podUID, contName, resource, allocDevices, resp.ContainerResponses[0])
|
||||
|
Loading…
Reference in New Issue
Block a user