mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Add more log messages for sandbox restarts
This commit is contained in:
parent
04437f6403
commit
2202688eef
@ -387,6 +387,7 @@ type podContainerSpecChanges struct {
|
||||
// (changed, new attempt, original sandboxID if exist).
|
||||
func (m *kubeGenericRuntimeManager) podSandboxChanged(pod *api.Pod, podStatus *kubecontainer.PodStatus) (changed bool, attempt uint32, sandboxID string) {
|
||||
if len(podStatus.SandboxStatuses) == 0 {
|
||||
glog.V(2).Infof("No sandbox for pod %q can be found. Need to start a new one", format.Pod(pod))
|
||||
return true, 0, ""
|
||||
}
|
||||
|
||||
@ -400,12 +401,14 @@ func (m *kubeGenericRuntimeManager) podSandboxChanged(pod *api.Pod, podStatus *k
|
||||
// Needs to create a new sandbox when readySandboxCount > 1 or the ready sandbox is not the latest one.
|
||||
sandboxStatus := podStatus.SandboxStatuses[0]
|
||||
if readySandboxCount > 1 || sandboxStatus.GetState() != runtimeApi.PodSandBoxState_READY {
|
||||
glog.V(2).Infof("No ready sandbox for pod %q can be found. Need to start a new one", format.Pod(pod))
|
||||
return true, sandboxStatus.Metadata.GetAttempt() + 1, sandboxStatus.GetId()
|
||||
}
|
||||
|
||||
// Needs to create a new sandbox when network namespace changed.
|
||||
if sandboxStatus.Linux != nil && sandboxStatus.Linux.Namespaces.Options != nil &&
|
||||
sandboxStatus.Linux.Namespaces.Options.GetHostNetwork() != kubecontainer.IsHostNetworkPod(pod) {
|
||||
glog.V(2).Infof("Sandbox for pod %q has changed. Need to start a new one", format.Pod(pod))
|
||||
return true, sandboxStatus.Metadata.GetAttempt() + 1, ""
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user