Repository navigation
[fix] trim whitespace and skip empty entries in linode-loadbalancer-tags - #654
Merged
Merged
Conversation
The tags annotation was split on commas as is, so "production, web-tier" sent " web-tier" to the API and a trailing comma sent an empty tag. Trim each entry and drop the empty ones. Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
komer3
approved these changes
Nov 6, 2026
komer3
left a comment
Contributor
There was a problem hiding this comment.
Thanks for contribution :)
komer3
enabled auto-merge (squash)
November 6, 2026 15:23
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #654 +/- ##
==========================================
+ Coverage 82.64% 82.65% +0.01%
==========================================
Files 19 19
Lines 2616 2618 +2
==========================================
+ Hits 2162 2164 +2
Misses 454 454 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
service.beta.kubernetes.io/linode-loadbalancer-tagsis split on commas without trimming, so a value written like the other list annotations,"production, web-tier", sends" web-tier"(leading space) to the NodeBalancer API, and a trailing or doubled comma ("production,,web-tier,") sends an empty tag. The same list is compared withreflect.DeepEqualagainstnb.TagsinupdateNodeBalancer, so the values stored by the API and the desired list can disagree on every sync.GetLoadBalancerTagsnow trims each entry and skips empty ones. Values that were already clean ("fake,test,yolo") produce the same list as before.Tests: added
Test_loadbalancers_GetLoadBalancerTags(no annotation, plain list, spaces after commas, empty entries, empty annotation). The last three fail on master and pass with the change.go test ./cloud/...andgolangci-lint run -c .golangci.yml ./cloud/linode/are clean.General:
Pull Request Guidelines: