Don't sort IngressStatus from each Goroutine(update for each ingress)
Currently ingress controller try to update status for each ingress resource in a parallel by using Goroutine, and inside this Goroutine we are trying to sort same IngressStatus reference which is shared between all Goroutine, this will break the original refrence if some Goroutine tried to sort exact same time. So we should have done sorting before passing reference to each Goroutine to prevent from breaking original reference fixes: #3269
This commit is contained in:
parent
864ee54af9
commit
0a2b2afe55
1 changed files with 1 additions and 2 deletions
|
@ -326,6 +326,7 @@ func (s *statusSync) updateStatus(newIngressPoint []apiv1.LoadBalancerIngress) {
|
||||||
defer p.Close()
|
defer p.Close()
|
||||||
|
|
||||||
batch := p.Batch()
|
batch := p.Batch()
|
||||||
|
sort.SliceStable(newIngressPoint, lessLoadBalancerIngress(newIngressPoint))
|
||||||
|
|
||||||
for _, ing := range ings {
|
for _, ing := range ings {
|
||||||
batch.Queue(runUpdate(ing, newIngressPoint, s.Client))
|
batch.Queue(runUpdate(ing, newIngressPoint, s.Client))
|
||||||
|
@ -342,8 +343,6 @@ func runUpdate(ing *extensions.Ingress, status []apiv1.LoadBalancerIngress,
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
sort.SliceStable(status, lessLoadBalancerIngress(status))
|
|
||||||
|
|
||||||
curIPs := ing.Status.LoadBalancer.Ingress
|
curIPs := ing.Status.LoadBalancer.Ingress
|
||||||
sort.SliceStable(curIPs, lessLoadBalancerIngress(curIPs))
|
sort.SliceStable(curIPs, lessLoadBalancerIngress(curIPs))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue