File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,15 @@ import (
19
19
)
20
20
21
21
var configPath string
22
+ var validateConfig bool
22
23
var autoReload bool
23
24
var cpuProfile string
24
25
var memProfile string
25
26
var globalLogger = zerolog .New (os .Stderr ).With ().Timestamp ().Logger ()
26
27
27
28
func main () {
28
29
flag .StringVar (& configPath , "config" , "" , "configuration file" )
30
+ flag .BoolVar (& validateConfig , "validate" , false , "validate configuration file and exit" )
29
31
flag .BoolVar (& autoReload , "autoreload" , false , "reload configuration file on k8s configmap update" )
30
32
flag .StringVar (& cpuProfile , "cpuprofile" , "" , "write cpu profile to `file`" )
31
33
flag .StringVar (& memProfile , "memprofile" , "" , "write memory profile to `file`" )
@@ -63,6 +65,11 @@ func main() {
63
65
globalLogger .Fatal ().Err (err ).Msg ("Failed creating applications" )
64
66
}
65
67
68
+ if validateConfig {
69
+ globalLogger .Info ().Msg ("Configuration file is valid" )
70
+ os .Exit (0 )
71
+ }
72
+
66
73
ctx , cancelFunc := context .WithCancel (context .Background ())
67
74
defer cancelFunc ()
68
75
You can’t perform that action at this time.
0 commit comments