Conversation
The release path built the full load balancer from the service annotations before cleaning up. An annotation that did not parse, such as a non-numeric retry count, failed the release before the balancer was deleted, so the finalizer stayed and the service could not be deleted or leave the LoadBalancer type. A release finds the balancer by the service UID label alone, so it now builds the load balancer from the UID and the Hetzner client only. Reconciliation still parses every annotation as before. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Service with a robotlb annotation that does not parse can't be deleted. With
robotlb/lb-retries: abc,sync_servicefailed on the annotation before it got to the release. The balancer was never deleted, the finalizer stayed, and the Service hung inTerminating. Changing such a Service away from typeLoadBalancergot stuck the same way.Release doesn't need the annotations. It finds the balancer by the
robotlb/service-uidlabel, so the Service UID and the Hetzner client are enough.LoadBalancer::for_releasebuilds only that.balancer_forpicks the constructor by role:for_releasefor a release,try_from_svcfor a reconcile. Reconcile is unchanged and still fails on a bad annotation. The role picks the constructor in this one place, so thefor_releasevalue (all other fields at default) never reaches reconcile.The rest of the release path doesn't read annotations either. That covers role detection, the rate limit gate, finalizer removal and the failure event.
Two unit tests. The one on
balancer_forchecks the routing: withlb-retries: abca release works and a reconcile fails, and a release of a Service without a UID is skipped. The one onfor_releasechecks that it keeps the UID even with that annotation. Cleanup looks the balancer up by the UID only, so an empty one would silently find nothing and leave the balancer behind.cargo test,cargo clippy --all-targetsandcargo fmtpass, with no new clippy warnings.One possible follow-up:
LoadBalancerderivesDefaultonly to fillfor_release. Listing the fields there would drop the publicLoadBalancer::default(), which has an empty UID.Stacked on #62.
Closes #42