Merge pull request #6029 from vishh/1726

Update pod ip using active container only.
This commit is contained in:
Vish Kannan 2015-03-26 17:50:35 -07:00
commit 13ae40681a

View File

@ -676,8 +676,10 @@ func GetDockerPodStatus(client DockerInterface, manifest api.PodSpec, podFullNam
if result.err != nil {
return nil, err
}
// Add user container information
if dockerContainerName == PodInfraContainerName {
if dockerContainerName == PodInfraContainerName &&
result.status.State.Running != nil {
// Found network container
podStatus.PodIP = result.ip
} else {
@ -685,6 +687,9 @@ func GetDockerPodStatus(client DockerInterface, manifest api.PodSpec, podFullNam
}
}
if podStatus.PodIP == "" {
return nil, ErrNoPodInfraContainerInPod
}
if len(statuses) == 0 && podStatus.PodIP == "" {
return nil, ErrNoContainersInPod
}