mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-30 23:57:46 +00:00
Assign host's IPAddress to podIP when pod shares the host's network
This commit is contained in:
parent
fb07b34cb8
commit
a6a57de646
@ -2161,6 +2161,9 @@ func (kl *Kubelet) generatePodStatus(pod *api.Pod) (api.PodStatus, error) {
|
||||
glog.V(4).Infof("Cannot get host IP: %v", err)
|
||||
} else {
|
||||
podStatus.HostIP = hostIP.String()
|
||||
if pod.Spec.HostNetwork && podStatus.PodIP == "" {
|
||||
podStatus.PodIP = hostIP.String()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user