mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47: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)
|
||||
contName := container.Name
|
||||
needsReAllocate := false
|
||||
for k := range container.Resources.Limits {
|
||||
for k, v := range container.Resources.Limits {
|
||||
resource := string(k)
|
||||
if !m.isDevicePluginResource(resource) {
|
||||
if !m.isDevicePluginResource(resource) || v.Value() == 0 {
|
||||
continue
|
||||
}
|
||||
err := m.callPreStartContainerIfNeeded(podUID, contName, resource)
|
||||
|
Loading…
Reference in New Issue
Block a user