fix: Sort TCP/UDP upstream order (#2885)

Fixes #2721
This commit is contained in:
Mike Bryant 2018-08-10 12:09:14 +01:00 committed by Manuel Alejandro de Brito Fontes
parent 77b922aa00
commit 6d9772ce00

View file

@ -337,6 +337,11 @@ func (n *NGINXController) getStreamServices(configmapName string, proto apiv1.Pr
})
}
// Keep upstream order sorted to reduce unnecessary nginx config reloads.
sort.SliceStable(svcs, func(i, j int) bool {
return svcs[i].Port < svcs[j].Port
})
return svcs
}