-
Notifications
You must be signed in to change notification settings - Fork 487
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
Configuration file validation subcommand for agentctl #336
Conversation
c0037ab
to
ad3c9a3
Compare
Thanks for working on this! I won't have time to review this until tomorrow, but I'll look at it as soon as I can |
Perform basic YAML and type checking for an Agent configuration file and exit with `1` if there are any errors loading, parsing, or validating the file. Fixes #329
ad3c9a3
to
65c95f1
Compare
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.
Nice! Really straightforward. Just two small comments.
cmd/agentctl/main.go
Outdated
cfg := config.Config{} | ||
err := config.LoadFile(file, expandEnv, &cfg) | ||
if err != nil { | ||
level.Error(logger).Log("msg", "failed to validate config", "err", err) |
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.
I think it'll be easier to read this if we just print normally:
fmt.Fprintf(os.Stderr, "failed to validate config: %s", err)
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.
Sounds good
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.
Thanks! I'll merge in a few, but feel free to merge yourself if you see the CI goes green before I'm back at my desk
* Configuration file validation subcommand for agentctl Perform basic YAML and type checking for an Agent configuration file and exit with `1` if there are any errors loading, parsing, or validating the file. Fixes #329 * CR feedback
Perform basic YAML and type checking for an Agent configuration file
and exit with
1
if there are any errors loading, parsing, or validatingthe file.
Fixes #329
PR Checklist