Skip to content

Commit e8ccd21

Browse files
mdboothEmilienM
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 Co-Authored-By: Emilien Macchi <[email protected]>
1 parent 634ccc7 commit e8ccd21

File tree

2 files changed

+568
-150
lines changed

2 files changed

+568
-150
lines changed

0 commit comments

Comments
 (0)