mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #6029 from vishh/1726
Update pod ip using active container only.
This commit is contained in:
commit
13ae40681a
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user