Conversation
The name from the robotlb/balancer annotation went to Hetzner as is. Hetzner takes 1 to 128 characters matching ^\S(.*\S)?$, so a name with whitespace at an edge, a line break or more than 128 characters failed with 422 on every retry. An empty annotation was taken as the name too and went into the name lookup before the create. Check the name before the balancer is looked up by name or created, and report the rule in a warning event on the service. A service whose balancer already carries its UID label does not use the name, so it keeps being managed whatever the annotation says, as before. A release still reads no annotations. Signed-off-by: Aleksei Sviridkin <f@lex.la> Assisted-by: LLM
Nothing reads robotlb/node-ip: neither the code nor the README or the Helm chart mention it, so the constant only suggests an annotation that does nothing. 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 balancer name from the
robotlb/balancerannotation now gets checked before robotlb looks a balancer up by that name or creates one. Before this, any value went to the API as is. Hetzner takes 1 to 128 characters matching^\S(.*\S)?$, per thenameschema ofPOST /load_balancersin its OpenAPI spec. So a name with whitespace at the start or end, a line break, or more than 128 characters failed with 422 on every retry. An empty value was used as the name too, first in the lookup and then in the create.A bad name fails the reconcile with a new
InvalidBalancerNameerror, and the usual failure path shows it as a warning event on the Service. The message states the rule before the name, since event notes get cut at 1024 bytes. The check sits right after the lookup by the service UID label, not inLoadBalancer::try_from_svc. A service whose balancer already carries that label never uses the name, so it keeps being managed whatever the annotation says, same as before. A release still reads no annotations.The check follows the regex dialect of the schema, ECMA-262. That decides the rare cases:
.stops at U+2028, and U+FEFF counts as whitespace. I can't tell which regex engine Hetzner runs on the server, so an odd character may still be judged differently there.The second commit drops the unused
LB_NODE_IP_LABEL_NAMEconstant. Nothing in the code, README or Helm chart readsrobotlb/node-ip.Uniqueness is not part of the check. A name already taken in the project is found by the lookup by name, and the service either uses that balancer or gets a warning event.
The README doesn't describe the name rule. It didn't before either, so I left it as is.
Stacked on #64.
Closes #61