mirror of https://github.com/k3s-io/k3s
kuberuntime: don't override the pod IP for pods using host network
parent
33eb8794c9
commit
ea868d6f7b
|
@ -628,10 +628,14 @@ func (m *kubeGenericRuntimeManager) SyncPod(pod *v1.Pod, _ v1.PodStatus, podStat
|
|||
return
|
||||
}
|
||||
|
||||
// If we ever allow updating a pod from non-host-network to
|
||||
// host-network, we may use a stale IP.
|
||||
if !kubecontainer.IsHostNetworkPod(pod) {
|
||||
// Overwrite the podIP passed in the pod status, since we just started the pod sandbox.
|
||||
podIP = m.determinePodSandboxIP(pod.Namespace, pod.Name, podSandboxStatus)
|
||||
glog.V(4).Infof("Determined the ip %q for pod %q after sandbox changed", podIP, format.Pod(pod))
|
||||
}
|
||||
}
|
||||
|
||||
// Get podSandboxConfig for containers to start.
|
||||
configPodSandboxResult := kubecontainer.NewSyncResult(kubecontainer.ConfigPodSandbox, podSandboxID)
|
||||
|
|
Loading…
Reference in New Issue