Skip to content

Commit f830ca8

Browse files
mdboothEmilienM
authored andcommitted
Reduce cyclomatic complexity of ReconcileLoadBalancer
This function had become genuinely too complex over time, to the point that even the linter was starting to complain about it when making almost any change. This change refactors ReconcileLoadBalancer into several smaller logical functions which are much easier to read and reason about. It also revealed some trivial optimisations: * Only fetch Octavia providers if we need them to create a new loadbalancer * Only calculate allowed CIDRs once * Don't re-fetch a loadbalancer to check it's active if it's already active
1 parent fd64e36 commit f830ca8

File tree

2 files changed

+209
-149
lines changed

2 files changed

+209
-149
lines changed

0 commit comments

Comments
 (0)