Skip to content

Commit

Permalink
feat: handle missing config file gracefully with a warning
Browse files Browse the repository at this point in the history
Signed-off-by: Dmytro Bondar <[email protected]>
  • Loading branch information
bonddim committed Dec 5, 2024
1 parent 81ff0cd commit 69d5d56
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 69d5d56

Please sign in to comment.