mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(resp.ContainerResponses) == 0 {
|
||||||
|
return fmt.Errorf("No containers return in allocation response %v", resp)
|
||||||
|
}
|
||||||
|
|
||||||
// Update internal cached podDevices state.
|
// Update internal cached podDevices state.
|
||||||
m.mutex.Lock()
|
m.mutex.Lock()
|
||||||
m.podDevices.insert(podUID, contName, resource, allocDevices, resp.ContainerResponses[0])
|
m.podDevices.insert(podUID, contName, resource, allocDevices, resp.ContainerResponses[0])
|
||||||
|
Loading…
Reference in New Issue
Block a user