diff --git a/pkg/config/config.go b/pkg/config/config.go index aa38a4856..8357e279a 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -440,17 +440,9 @@ func getConfigValueFromFile(configKey string) string { return "" } -func readConfigvaluesFromFiles() { +func readConfigValuesFromFiles() { keys := viper.AllKeys() for _, key := range keys { - if strings.HasSuffix(key, "_file") { - value := getConfigValueFromFile(key) - if value != "" { - viper.Set(strings.TrimSuffix(key, "_file"), value) - } - continue - } - // Env is evaluated manually at runtime, so we need to check this for each key value := getConfigValueFromFile(key + ".file") if value != "" { @@ -503,7 +495,7 @@ func InitConfig() { log.Info("No config file found, using default or config from environment variables.") } - readConfigvaluesFromFiles() + readConfigValuesFromFiles() if RateLimitStore.GetString() == "keyvalue" { RateLimitStore.Set(KeyvalueType.GetString())