mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
Merge pull request #112097 from wongearl/cleanup_loop
use copy() instead of a loop
This commit is contained in:
commit
be22f605cf
@ -1586,9 +1586,7 @@ func (kl *Kubelet) convertStatusToAPIStatus(pod *v1.Pod, podStatus *kubecontaine
|
||||
|
||||
// copy pod status IPs to avoid race conditions with PodStatus #102806
|
||||
podIPs := make([]string, len(podStatus.IPs))
|
||||
for j, ip := range podStatus.IPs {
|
||||
podIPs[j] = ip
|
||||
}
|
||||
copy(podIPs, podStatus.IPs)
|
||||
|
||||
// make podIPs order match node IP family preference #97979
|
||||
podIPs = kl.sortPodIPs(podIPs)
|
||||
|
Loading…
Reference in New Issue
Block a user