mirror of
https://github.com/prymitive/karma
synced 2026-08-17 11:27:01 +00:00
feat(backend): add --check-config flag for validating configuration
Fixes #735
This commit is contained in:
@@ -171,7 +171,9 @@ func setupLogger() {
|
||||
|
||||
func main() {
|
||||
printVersion := pflag.Bool("version", false, "Print version and exit")
|
||||
validateConfig := pflag.Bool("check-config", false, "Validate configuration and exit")
|
||||
pflag.Parse()
|
||||
|
||||
if *printVersion {
|
||||
fmt.Println(version)
|
||||
return
|
||||
@@ -204,6 +206,11 @@ func main() {
|
||||
log.Fatal("No valid Alertmanager URIs defined")
|
||||
}
|
||||
|
||||
if *validateConfig {
|
||||
log.Info("Configuration is valid")
|
||||
return
|
||||
}
|
||||
|
||||
// before we start try to fetch data from Alertmanager
|
||||
log.Info("Initial Alertmanager query")
|
||||
pullFromAlertmanager()
|
||||
|
||||
Reference in New Issue
Block a user