-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clustering: fix handling of empty join-addresses flag #5454
clustering: fix handling of empty join-addresses flag #5454
Conversation
Signed-off-by: Paschalis Tsilias <[email protected]>
Signed-off-by: Paschalis Tsilias <[email protected]>
|
||
func TestBuildClusterService(t *testing.T) { | ||
opts := clusterOptions{ | ||
JoinPeers: []string{"foo", "bar"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we have a test with JoinPeers
empty string somewhere, or setting a flag to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, looking into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(sorry, didn't post the comment beforehand).
After taking a look we don't have a good place for putting tests related to flag parsing. I'd like to (sooner or later) move ahead with #4973 which would cover this. I'm merging this to move ahead with the patch release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment re: test, but not blocking :) Thanks for the quick fix!
Hi, I am the one who reported this defect #108849 grafana-agent-flow clustering mode error. Seems you guys have fixed it. Thanks. |
You're welcome @juyongli! Let us know how clustering works for you and any other feedback you may have! |
Signed-off-by: Paschalis Tsilias <[email protected]> (cherry picked from commit 0a5a5aa)
PR Description
We recently almost had this bite us when porting the cadvisor integration to a new component.
strings.Split
returns the input string itself if the separator is not found; this meant that for an empty flag,strings.Split("", ",")
returned a 1-element slice with the empty string, and not an empty slice.Which issue(s) this PR fixes
Fixes #5449
Notes to the Reviewer
Nothing to note.
PR Checklist