mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
Fix: kubelet return error when device plugin sets PreStartRequired true while creating pods with 0 resource
This commit is contained in:
parent
ece591f722
commit
0eaceb7eb5
@ -932,9 +932,9 @@ func (m *ManagerImpl) GetDeviceRunContainerOptions(pod *v1.Pod, container *v1.Co
|
|||||||
podUID := string(pod.UID)
|
podUID := string(pod.UID)
|
||||||
contName := container.Name
|
contName := container.Name
|
||||||
needsReAllocate := false
|
needsReAllocate := false
|
||||||
for k := range container.Resources.Limits {
|
for k, v := range container.Resources.Limits {
|
||||||
resource := string(k)
|
resource := string(k)
|
||||||
if !m.isDevicePluginResource(resource) {
|
if !m.isDevicePluginResource(resource) || v.Value() == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
err := m.callPreStartContainerIfNeeded(podUID, contName, resource)
|
err := m.callPreStartContainerIfNeeded(podUID, contName, resource)
|
||||||
|
Loading…
Reference in New Issue
Block a user