Skip to content

Commit

Permalink
Fail when the builder can't load its configuration.
Browse files Browse the repository at this point in the history
If the builder can't load its build configuration file, it logs an error
and continues. This results in building a collector that is not the one
the user specified. Exit with a fatal error instead.

Signed-off-by: James Peach <[email protected]>
  • Loading branch information
jpeach committed Jul 22, 2022
1 parent 61c6989 commit 7fc5572
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/builder/internal/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func initConfig() error {

// load the config file
if err := k.Load(file.Provider(cfgFile), yaml.Parser()); err != nil {
cfg.Logger.Error("failed to load config file", zap.String("config-file", cfgFile), zap.Error(err))
cfg.Logger.Fatal("failed to load config file", zap.String("config-file", cfgFile), zap.Error(err))
}

// handle env variables
Expand Down

0 comments on commit 7fc5572

Please sign in to comment.