mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Merge pull request #43539 from yujuhong/hostnet_ip
Automatic merge from submit-queue (batch tested with PRs 43533, 43539) kuberuntime: don't override the pod IP for pods using host network This fixes the issue of not passing pod IP via downward API for host network pods.
This commit is contained in:
commit
7c24d1a665
@ -628,9 +628,13 @@ func (m *kubeGenericRuntimeManager) SyncPod(pod *v1.Pod, _ v1.PodStatus, podStat
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overwrite the podIP passed in the pod status, since we just started the pod sandbox.
|
// If we ever allow updating a pod from non-host-network to
|
||||||
podIP = m.determinePodSandboxIP(pod.Namespace, pod.Name, podSandboxStatus)
|
// host-network, we may use a stale IP.
|
||||||
glog.V(4).Infof("Determined the ip %q for pod %q after sandbox changed", podIP, format.Pod(pod))
|
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.
|
// Get podSandboxConfig for containers to start.
|
||||||
|
Loading…
Reference in New Issue
Block a user