fix captured loop variable

pull/6/head
Daniel Smith 2014-10-07 13:57:30 -07:00
parent 7ffe791486
commit 2d048bc0f2
1 changed files with 2 additions and 1 deletions

View File

@ -59,7 +59,8 @@ func (kl *Kubelet) runOnce(pods []Pod) (results []RunPodResult, err error) {
pods = filterHostPortConflicts(pods)
ch := make(chan RunPodResult)
for _, pod := range pods {
for i := range pods {
pod := pods[i] // Make a copy
go func() {
info, err := kl.runPod(pod)
ch <- RunPodResult{&pod, info, err}