Sort ingresses by creation timestamp

This commit is contained in:
Manuel Alejandro de Brito Fontes 2018-12-19 10:58:42 -03:00
parent cac694ecce
commit b2fa243b97
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
3 changed files with 29 additions and 9 deletions

View file

@ -120,13 +120,7 @@ func (n *NGINXController) syncIngress(interface{}) error {
return nil
}
// sort Ingresses using the ResourceVersion field
ings := n.store.ListIngresses()
sort.SliceStable(ings, func(i, j int) bool {
ir := ings[i].ResourceVersion
jr := ings[j].ResourceVersion
return ir < jr
})
upstreams, servers := n.getBackendServers(ings)
var passUpstreams []*ingress.SSLPassthroughBackend