From 7fc557282f68a9bed9bdd6c0c9fc21c4bb4299f2 Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 22 Jul 2022 11:28:34 +1000 Subject: [PATCH] Fail when the builder can't load its configuration. 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 --- cmd/builder/internal/command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/builder/internal/command.go b/cmd/builder/internal/command.go index 3dee3a6e586..a825bf4c333 100644 --- a/cmd/builder/internal/command.go +++ b/cmd/builder/internal/command.go @@ -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