@@ -265,26 +265,24 @@ func (az *Cloud) getServiceLoadBalancer(service *v1.Service, clusterName string,
265
265
}
266
266
267
267
// check if the service already has a load balancer
268
- if existingLBs != nil {
269
- for i := range existingLBs {
270
- existingLB := existingLBs [i ]
271
- if strings .EqualFold (* existingLB .Name , defaultLBName ) {
272
- defaultLB = & existingLB
273
- }
274
- if isInternalLoadBalancer (& existingLB ) != isInternal {
275
- continue
276
- }
277
- status , err = az .getServiceLoadBalancerStatus (service , & existingLB )
278
- if err != nil {
279
- return nil , nil , false , err
280
- }
281
- if status == nil {
282
- // service is not on this load balancer
283
- continue
284
- }
285
-
286
- return & existingLB , status , true , nil
268
+ for i := range existingLBs {
269
+ existingLB := existingLBs [i ]
270
+ if strings .EqualFold (* existingLB .Name , defaultLBName ) {
271
+ defaultLB = & existingLB
287
272
}
273
+ if isInternalLoadBalancer (& existingLB ) != isInternal {
274
+ continue
275
+ }
276
+ status , err = az .getServiceLoadBalancerStatus (service , & existingLB )
277
+ if err != nil {
278
+ return nil , nil , false , err
279
+ }
280
+ if status == nil {
281
+ // service is not on this load balancer
282
+ continue
283
+ }
284
+
285
+ return & existingLB , status , true , nil
288
286
}
289
287
290
288
hasMode , _ , _ := getServiceLoadBalancerMode (service )
0 commit comments