From 5c17d5b90c3e1807dd30d604bc7285441c169226 Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 23 May 2025 12:47:56 +0200 Subject: [PATCH] fix(config): set value when env variable contains string value --- pkg/config/config.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 2d9ca4f91..49f7002a0 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -502,7 +502,8 @@ func setConfigFromEnv() error { currentMap := configMap for i, part := range keys { - if i == len(keys)-1 { + _, isString := currentMap[part].(string) + if i == len(keys)-1 || isString { // Set the value at the final level currentMap[part] = value } else { @@ -514,7 +515,7 @@ func setConfigFromEnv() error { // Move into the nested map typed, is := currentMap[part].(map[string]any) if !is { - log.Errorf("Failed to set config value from environment variable %s: %s, failed on part %s, type is not map, is %t", key, value, part, currentMap[part]) + log.Errorf("Failed to set config value from environment variable %s: %s, failed on part %s, type is not map, is %T", key, value, part, currentMap[part]) continue }