mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +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
|
// copy pod status IPs to avoid race conditions with PodStatus #102806
|
||||||
podIPs := make([]string, len(podStatus.IPs))
|
podIPs := make([]string, len(podStatus.IPs))
|
||||||
for j, ip := range podStatus.IPs {
|
copy(podIPs, podStatus.IPs)
|
||||||
podIPs[j] = ip
|
|
||||||
}
|
|
||||||
|
|
||||||
// make podIPs order match node IP family preference #97979
|
// make podIPs order match node IP family preference #97979
|
||||||
podIPs = kl.sortPodIPs(podIPs)
|
podIPs = kl.sortPodIPs(podIPs)
|
||||||
|
Loading…
Reference in New Issue
Block a user