Skip to content

Commit

Permalink
fix(config): env var prefix clashing in k8s (#937)
Browse files Browse the repository at this point in the history
* fix: log config error

* fix: add extra underscore to env prefix

* fix: config revert

* chore: add web/.gitkeep

* chore: fix web/dist/.gitkeep

* fix: add extra underscore to env prefix
  • Loading branch information
zze0s committed May 15, 2023
1 parent 6898ad8 commit d31866b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,14 @@ func (c *AppConfig) load(configPath string) {

for _, key := range viper.AllKeys() {
envKey := strings.ToUpper(strings.ReplaceAll(key, ".", "_"))
err := viper.BindEnv(key, "AUTOBRR_"+envKey)
err := viper.BindEnv(key, "AUTOBRR__"+envKey)
if err != nil {
log.Fatal("config: unable to bind env: " + err.Error())
}
}

if err := viper.Unmarshal(c.Config); err != nil {
log.Fatalf("Could not unmarshal config file: %v", viper.ConfigFileUsed())
log.Fatalf("Could not unmarshal config file: %v: err %q", viper.ConfigFileUsed(), err)
}
}

Expand Down

0 comments on commit d31866b

Please sign in to comment.