Skip to content

Commit

Permalink
feat: handle missing config file gracefully with a warning (#331)
Browse files Browse the repository at this point in the history
Signed-off-by: Dmytro Bondar <[email protected]>
  • Loading branch information
bonddim authored Dec 10, 2024
1 parent 983568b commit 0ea24e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ func GetConfig() (*Config, error) {
func loadConfigFile(cfg any, filename string) error {
data, err := envsubst.ReadFile(filename)
if err != nil {
if os.IsNotExist(err) {
logrus.Warnf("Config file %s not found, using default values", filename)
return nil
}
return fmt.Errorf("envsubst error: %v", err)
}

Expand Down

0 comments on commit 0ea24e3

Please sign in to comment.