Merge pull request #433 from ibawt/fix-scoping

close over the ingress variable or the last assignment will be used
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-03-13 22:16:33 -03:00 committed by GitHub
commit 7c17dc31e7

View file

@ -252,7 +252,7 @@ func (s *statusSync) updateStatus(newIPs []api.LoadBalancerIngress) {
continue continue
} }
go func(wg *sync.WaitGroup) { go func(wg *sync.WaitGroup, ing *extensions.Ingress) {
defer wg.Done() defer wg.Done()
ingClient := s.Client.Extensions().Ingresses(ing.Namespace) ingClient := s.Client.Extensions().Ingresses(ing.Namespace)
currIng, err := ingClient.Get(ing.Name) currIng, err := ingClient.Get(ing.Name)
@ -274,7 +274,7 @@ func (s *statusSync) updateStatus(newIPs []api.LoadBalancerIngress) {
if err != nil { if err != nil {
glog.Warningf("error updating ingress rule: %v", err) glog.Warningf("error updating ingress rule: %v", err)
} }
}(&wg) }(&wg, ing)
} }
wg.Wait() wg.Wait()