Skip to content

Commit 8476f12

Browse files
committed
Review comments
1 parent 253b4f1 commit 8476f12

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cloud/linode/loadbalancers.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ func (l *loadbalancers) EnsureLoadBalancer(ctx context.Context, clusterName stri
231231
return lbStatus, nil
232232
}
233233

234-
// getNodeBalancerDeviceId gets the deviceID of the nodeBalancer that is attached to the firewall.
235-
func (l *loadbalancers) getNodeBalancerDeviceId(ctx context.Context, firewallID, nbID int) (int, bool, error) {
234+
// getNodeBalancerDeviceID gets the deviceID of the nodeBalancer that is attached to the firewall.
235+
func (l *loadbalancers) getNodeBalancerDeviceID(ctx context.Context, firewallID, nbID int) (int, bool, error) {
236236
devices, err := l.client.ListFirewallDevices(ctx, firewallID, &linodego.ListOptions{})
237237
if err != nil {
238238
return 0, false, err
@@ -271,6 +271,7 @@ func (l *loadbalancers) updateFirewallwithID(ctx context.Context, service *v1.Se
271271
return err
272272
}
273273
if len(firewalls) > 1 {
274+
klog.Errorf("Found more than one firewall attached to nodebalancer: %d, firewall IDs: %v", nb.ID, firewalls)
274275
return errTooManyFirewalls
275276
}
276277

@@ -292,7 +293,7 @@ func (l *loadbalancers) updateFirewallwithID(ctx context.Context, service *v1.Se
292293
}
293294
// remove the existing firewall if it exists
294295
if existingFirewallID != 0 {
295-
deviceID, deviceExists, err := l.getNodeBalancerDeviceId(ctx, existingFirewallID, nb.ID)
296+
deviceID, deviceExists, err := l.getNodeBalancerDeviceID(ctx, existingFirewallID, nb.ID)
296297
if err != nil {
297298
return err
298299
}
@@ -430,6 +431,7 @@ func (l *loadbalancers) updateFWwithACL(ctx context.Context, service *v1.Service
430431
}
431432
}
432433
default:
434+
klog.Errorf("Found more than one firewall attached to nodebalancer: %d, firewall IDs: %v", nb.ID, firewalls)
433435
return errTooManyFirewalls
434436
}
435437
return nil
@@ -474,6 +476,7 @@ func (l *loadbalancers) updateNodeBalancerFirewall(ctx context.Context, service
474476
return nil
475477
}
476478
if len(firewalls) > 1 {
479+
klog.Errorf("Found more than one firewall attached to nodebalancer: %d, firewall IDs: %v", nb.ID, firewalls)
477480
return errTooManyFirewalls
478481
}
479482

0 commit comments

Comments
 (0)