mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
fix captured loop variable
This commit is contained in:
parent
7ffe791486
commit
2d048bc0f2
@ -59,7 +59,8 @@ func (kl *Kubelet) runOnce(pods []Pod) (results []RunPodResult, err error) {
|
|||||||
pods = filterHostPortConflicts(pods)
|
pods = filterHostPortConflicts(pods)
|
||||||
|
|
||||||
ch := make(chan RunPodResult)
|
ch := make(chan RunPodResult)
|
||||||
for _, pod := range pods {
|
for i := range pods {
|
||||||
|
pod := pods[i] // Make a copy
|
||||||
go func() {
|
go func() {
|
||||||
info, err := kl.runPod(pod)
|
info, err := kl.runPod(pod)
|
||||||
ch <- RunPodResult{&pod, info, err}
|
ch <- RunPodResult{&pod, info, err}
|
||||||
|
Loading…
Reference in New Issue
Block a user