Move amtool to modular structure#1321
Merged
stuartnelson3 merged 4 commits intomasterfrom Apr 13, 2018
Merged
Conversation
Signed-off-by: Stuart Nelson <stuartnelson3@gmail.com>
b92f7f0 to
a485015
Compare
cli/alert.go
Outdated
| var ( | ||
| a = &alertQueryCmd{} | ||
| alertCmd = app.Command("alert", "View and search through current alerts") | ||
| alertQueryCmd = alertCmd.Command("query", "View and search through current alerts").Default() |
Member
There was a problem hiding this comment.
I find it a bit confusing to have both alertQueryCmd as a local variable here and as a global struct.
Contributor
Author
There was a problem hiding this comment.
ah didn't even notice, yes that is confusing
| @@ -0,0 +1,57 @@ | |||
| package cli | |||
Member
There was a problem hiding this comment.
I've already noticed that most of the files in the cli package are missing the Apache 2 license header. This shouldn't be addressed in this PR but rather tackled once prometheus/prometheus#3904 is fixed.
Signed-off-by: Stuart Nelson <stuartnelson3@gmail.com>
A local variable within the alert subcommand was using the name of the struct within that file. Signed-off-by: Stuart Nelson <stuartnelson3@gmail.com>
8f4e0fd to
0b40787
Compare
Contributor
Author
|
@simonpasquier any more comments/fixes? |
simonpasquier
requested changes
Apr 13, 2018
cli/check_config.go
Outdated
| func configureCheckConfigCmd(app *kingpin.Application, longHelpText map[string]string) { | ||
| var ( | ||
| c = &checkConfigCmd{} | ||
| checkConfigCmd = app.Command("check-config", "Validate alertmanager config files") |
Member
There was a problem hiding this comment.
Same confusing names with the struct declared at L12.
Signed-off-by: Stuart Nelson <stuartnelson3@gmail.com>
fc7e8a5 to
01e7258
Compare
Member
|
👍 |
mxinden
pushed a commit
to mxinden/alertmanager
that referenced
this pull request
May 5, 2018
* Move amtool to modular structure Signed-off-by: Stuart Nelson <stuartnelson3@gmail.com> * Move toplevel setup back into root.go Signed-off-by: Stuart Nelson <stuartnelson3@gmail.com> * Remove confusing alert struct name overwriting A local variable within the alert subcommand was using the name of the struct within that file. Signed-off-by: Stuart Nelson <stuartnelson3@gmail.com> * change local var name shadowing struct name Signed-off-by: Stuart Nelson <stuartnelson3@gmail.com>
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.
implements #1297