Refactor/octavia loadbalancer - #3156
Conversation
Extract serviceName, checkLoadBalancerActive, resolveLBConfig, setPreferredIPFamily, poolProtocol, listener deletion helpers, and isListenerOwnedByService to remove duplication.
Break down ensureOctaviaLoadBalancer, checkService, ensureFloatingIP, createOctaviaLoadBalancer, ensureOctaviaListener/Pool, ensureLoadBalancerDeleted, deleteLoadBalancer, and checkServiceUpdate into focused helpers; convert getLoadBalancerByName/getSubnetIDForLB to methods.
Use %w error wrapping and errors.Is for sentinel checks; align error message wording.
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Hi @yahor-kurachkin. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@kayrus I think it would be better if you reviewed this PR, since you have the most context around this task. I can reorganize the PR differently, for example by splitting it into smaller PRs. Let me know what would be easier for you to review. |
What this PR does / why we need it:
Refactors pkg/openstack/loadbalancer.go for readability and maintainability with no functional changes — extracting helpers, decomposing large functions, standardizing error handling, and adding docs. Split into four reviewable phase commits; all existing tests pass.
Which issue this PR fixes(if applicable):
#3076
Special notes for reviewers:
I think this file will eventually need to be split into several smaller files, and the current section organization may help with that.
Release note: