mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Update pod ip using active container only.
This commit is contained in:
parent
622d47a8b9
commit
14a48ad026
@ -676,8 +676,10 @@ func GetDockerPodStatus(client DockerInterface, manifest api.PodSpec, podFullNam
|
|||||||
if result.err != nil {
|
if result.err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add user container information
|
// Add user container information
|
||||||
if dockerContainerName == PodInfraContainerName {
|
if dockerContainerName == PodInfraContainerName &&
|
||||||
|
result.status.State.Running != nil {
|
||||||
// Found network container
|
// Found network container
|
||||||
podStatus.PodIP = result.ip
|
podStatus.PodIP = result.ip
|
||||||
} else {
|
} 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 == "" {
|
if len(statuses) == 0 && podStatus.PodIP == "" {
|
||||||
return nil, ErrNoContainersInPod
|
return nil, ErrNoContainersInPod
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user