mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
kubelet: fix panic triggered when playing with a wip CRI
This commit is contained in:
parent
3866cb91f2
commit
3c65728ede
@ -496,7 +496,7 @@ func (m *kubeGenericRuntimeManager) podSandboxChanged(pod *v1.Pod, podStatus *ku
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Needs to create a new sandbox when the sandbox does not have an IP address.
|
// Needs to create a new sandbox when the sandbox does not have an IP address.
|
||||||
if !kubecontainer.IsHostNetworkPod(pod) && sandboxStatus.Network.Ip == "" {
|
if !kubecontainer.IsHostNetworkPod(pod) && sandboxStatus.Network != nil && sandboxStatus.Network.Ip == "" {
|
||||||
klog.V(2).InfoS("Sandbox for pod has no IP address. Need to start a new one", "pod", klog.KObj(pod))
|
klog.V(2).InfoS("Sandbox for pod has no IP address. Need to start a new one", "pod", klog.KObj(pod))
|
||||||
return true, sandboxStatus.Metadata.Attempt + 1, sandboxStatus.Id
|
return true, sandboxStatus.Metadata.Attempt + 1, sandboxStatus.Id
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user