Repository navigation
Conversation
renameLoadBalancer reused oldClusterName for the pool's cluster-name and then passed it to replaceClusterName for the listener. When the pool was already renamed, for example because a previous attempt failed right after renaming the pool, the listener name was "renamed" from the new cluster-name to itself and kept the old one. The load balancer was then renamed and the listener was never fixed on later syncs. Keep the pool's cluster-name in its own variable. Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
|
[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 |
|
Welcome @lbarrosby! |
|
Hi @lbarrosby. 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. |
What this PR does / why we need it:
renameLoadBalancerreuses theoldClusterNamevariable for the pool's cluster-name and then uses it to rename the listener. If the pool already carries the new cluster-name but the listener does not, the listener is "renamed" from the new cluster-name to itself and keeps the old name.This happens when a previous rename attempt renamed the pool and then failed before updating the listener (for example a timeout waiting for the LB to go ACTIVE). On the next sync the listener still has the old cluster-name, the pool is skipped, the listener update is a no-op, and the load balancer itself is renamed at the end. After that
lbHasOldClusterNamereturns false, so the listener is never fixed.The fix keeps the pool's cluster-name in its own variable, so the listener is always renamed using the cluster-name parsed from its own name.
Which issue this PR fixes(if applicable):
N/A
Special notes for reviewers:
Added
TestRenameLoadBalancerListenerWithRenamedPool, which runsrenameLoadBalanceragainst anhttptestserver with a listener namedlistener_0_kube_service_old_namespace_nameand a pool already namedpool_0_kube_service_new_namespace_name. Before the fix the listener update is sent with the old name and the test fails; with the fix it getslistener_0_kube_service_new_namespace_name.go test ./pkg/openstack/andgolangci-lint run ./pkg/openstack/...pass.This PR was written in part with the assistance of generative AI.
Release note: