Restore check when getting container IP

This commit is contained in:
Alexander Brand 2016-10-25 11:49:05 -04:00 committed by Paulo Pires
parent 244152544c
commit 9ef35289e4
No known key found for this signature in database
GPG Key ID: F3F6ED5C522EAA71

View File

@ -422,11 +422,13 @@ func (dm *DockerManager) inspectContainer(id string, podName, podNamespace strin
// Container that are running, restarting and paused
status.State = kubecontainer.ContainerStateRunning
status.StartedAt = startedAt
ip, err = dm.determineContainerIP(podNamespace, podName, iResult)
// Kubelet doesn't handle the network error scenario
if err != nil {
status.State = kubecontainer.ContainerStateUnknown
status.Message = fmt.Sprintf("Network error: %#v", err)
if containerProvidesPodIP(dockerName) {
ip, err = dm.determineContainerIP(podNamespace, podName, iResult)
// Kubelet doesn't handle the network error scenario
if err != nil {
status.State = kubecontainer.ContainerStateUnknown
status.Message = fmt.Sprintf("Network error: %#v", err)
}
}
return &status, ip, nil
}