Merge pull request #79700 from khenidak/fix-downward

kubelet: fix ip reporting for downward api
This commit is contained in:
Kubernetes Prow Robot 2019-07-03 16:46:13 -07:00 committed by GitHub
commit 8482582094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1525,6 +1525,11 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
for _, ipInfo := range apiPodStatus.PodIPs { for _, ipInfo := range apiPodStatus.PodIPs {
podStatus.IPs = append(podStatus.IPs, ipInfo.IP) podStatus.IPs = append(podStatus.IPs, ipInfo.IP)
} }
if len(podStatus.IPs) == 0 && len(apiPodStatus.PodIP) > 0 {
podStatus.IPs = []string{apiPodStatus.PodIP}
}
// Record the time it takes for the pod to become running. // Record the time it takes for the pod to become running.
existingStatus, ok := kl.statusManager.GetPodStatus(pod.UID) existingStatus, ok := kl.statusManager.GetPodStatus(pod.UID)
if !ok || existingStatus.Phase == v1.PodPending && apiPodStatus.Phase == v1.PodRunning && if !ok || existingStatus.Phase == v1.PodPending && apiPodStatus.Phase == v1.PodRunning &&