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 d9b5b02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- Expose `pcommon.NewSliceFromRaw` function (#5679)
- `loggingexporter`: create the exporter's logger from the service's logger (#5677)
- Add `otelcol_exporter_queue_capacity` metrics show the collector's exporter queue capacity (#5475)
- `ocb` now exits with an error if it fails to load the build configuration. (#5731)

### 🧰 Bug fixes 🧰

Expand Down
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 d9b5b02

Please sign in to comment.