Merge pull request #112097 from wongearl/cleanup_loop

use copy() instead of a loop
This commit is contained in:
Kubernetes Prow Robot 2022-09-30 18:04:12 -07:00 committed by GitHub
commit be22f605cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)