Skip to content

Commit

Permalink
Merge pull request kubernetes#6029 from vishh/1726
Browse files Browse the repository at this point in the history
Update pod ip using active container only.
  • Loading branch information
vishh committed Mar 27, 2015
2 parents f2c7dda + 14a48ad commit 13ae406
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/kubelet/dockertools/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,15 +676,20 @@ 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 {
statuses[dockerContainerName] = result.status
}
}

if podStatus.PodIP == "" {
return nil, ErrNoPodInfraContainerInPod
}
if len(statuses) == 0 && podStatus.PodIP == "" {
return nil, ErrNoContainersInPod
}
Expand Down

0 comments on commit 13ae406

Please sign in to comment.