Commit a23d9b51 authored by Pengfei Ni's avatar Pengfei Ni

Ensure expected load balancer is selected for Azure

Without this, the last element of LB list is always selected.
parent baab3992
...@@ -188,7 +188,8 @@ func (az *Cloud) getServiceLoadBalancer(service *v1.Service, clusterName string, ...@@ -188,7 +188,8 @@ func (az *Cloud) getServiceLoadBalancer(service *v1.Service, clusterName string,
// check if the service already has a load balancer // check if the service already has a load balancer
if existingLBs != nil { if existingLBs != nil {
for _, existingLB := range existingLBs { for i := range existingLBs {
existingLB := existingLBs[i]
if strings.EqualFold(*existingLB.Name, defaultLBName) { if strings.EqualFold(*existingLB.Name, defaultLBName) {
defaultLB = &existingLB defaultLB = &existingLB
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment