mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 19:23:40 +00:00
Do not fail if failed to get host IP
This commit is contained in:
parent
8d94c43e70
commit
fe2f7f25c6
@ -1924,9 +1924,10 @@ func (kl *Kubelet) generatePodStatusByPod(pod *api.Pod) (api.PodStatus, error) {
|
|||||||
podStatus.Host = kl.GetHostname()
|
podStatus.Host = kl.GetHostname()
|
||||||
hostIP, err := kl.GetHostIP()
|
hostIP, err := kl.GetHostIP()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return api.PodStatus{}, fmt.Errorf("Cannot get host IP: %v", err)
|
glog.Errorf("Cannot get host IP: %v", err)
|
||||||
|
} else {
|
||||||
|
podStatus.HostIP = hostIP.String()
|
||||||
}
|
}
|
||||||
podStatus.HostIP = hostIP.String()
|
|
||||||
|
|
||||||
return *podStatus, nil
|
return *podStatus, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user