File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,10 @@ func RunKubeStateMetricsWrapper(opts *options.Options) {
52
52
if err = cfgViper .ReadInConfig (); err != nil {
53
53
if errors .Is (err , viper.ConfigFileNotFoundError {}) {
54
54
klog .InfoS ("Options configuration file not found at startup" , "file" , file )
55
+ } else if _ , err = os .Stat (filepath .Clean (file )); os .IsNotExist (err ) {
56
+ // Adding this check in addition to the above since viper.ConfigFileNotFoundError is not working as expected due to this issue -
57
+ // https://github.com/spf13/viper/issues/1783
58
+ klog .InfoS ("Options configuration file not found at startup" , "file" , file )
55
59
} else {
56
60
klog .ErrorS (err , "Error reading options configuration file" , "file" , file )
57
61
klog .FlushAndExit (klog .ExitFlushTimeout , 1 )
You can’t perform that action at this time.
0 commit comments