mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 22:33:34 +00:00
Restore check when getting container IP
This commit is contained in:
parent
244152544c
commit
9ef35289e4
@ -422,11 +422,13 @@ func (dm *DockerManager) inspectContainer(id string, podName, podNamespace strin
|
|||||||
// Container that are running, restarting and paused
|
// Container that are running, restarting and paused
|
||||||
status.State = kubecontainer.ContainerStateRunning
|
status.State = kubecontainer.ContainerStateRunning
|
||||||
status.StartedAt = startedAt
|
status.StartedAt = startedAt
|
||||||
ip, err = dm.determineContainerIP(podNamespace, podName, iResult)
|
if containerProvidesPodIP(dockerName) {
|
||||||
// Kubelet doesn't handle the network error scenario
|
ip, err = dm.determineContainerIP(podNamespace, podName, iResult)
|
||||||
if err != nil {
|
// Kubelet doesn't handle the network error scenario
|
||||||
status.State = kubecontainer.ContainerStateUnknown
|
if err != nil {
|
||||||
status.Message = fmt.Sprintf("Network error: %#v", err)
|
status.State = kubecontainer.ContainerStateUnknown
|
||||||
|
status.Message = fmt.Sprintf("Network error: %#v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return &status, ip, nil
|
return &status, ip, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user