Ensure expected load balancer is selected for Azure

Without this, the last element of LB list is always selected.
This commit is contained in:
Pengfei Ni 2018-04-12 15:57:44 +08:00
parent e7ed9b408a
commit 0f0e271936

View File

@ -199,7 +199,8 @@ func (az *Cloud) getServiceLoadBalancer(service *v1.Service, clusterName string,
// check if the service already has a load balancer
if existingLBs != nil {
for _, existingLB := range existingLBs {
for i := range existingLBs {
existingLB := existingLBs[i]
if strings.EqualFold(*existingLB.Name, defaultLBName) {
defaultLB = &existingLB
}