Skip to content
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

Add CLI flag to verify config and exit #187

Merged
merged 2 commits into from
Mar 1, 2021
Merged

Add CLI flag to verify config and exit #187

merged 2 commits into from
Mar 1, 2021

Conversation

zswanson
Copy link
Contributor

This change adds a CLI flag to verify the config file/options load successfully, then exit. This allows verification of config files in CICD, where the app needs to gracefully exit or can't easily run in a managed way.

Output on valid config:

 $ ./prometheus-nginxlog-exporter -config-file example-config.hcl -verify-config true
loading configuration file example-config.hcl
Configuration is valid

Copy link
Owner

@martin-helmich martin-helmich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! 👍 in general on this change -- validating config files in a CI/CD context was not something I've had on my radar. Given just a tiny bit of documentation, I'll be happy to merge it as-is.

main.go Show resolved Hide resolved
@codeclimate
Copy link

codeclimate bot commented Mar 1, 2021

Code Climate has analyzed commit cfdf37a and detected 0 issues on this pull request.

View more on Code Climate.

@martin-helmich martin-helmich merged commit eb8b9f3 into martin-helmich:master Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants