mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
use copy() instead of a loop
This commit is contained in:
parent
50097acf15
commit
47bd712b81
@ -1587,9 +1587,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