From 3a0fa8a77c9b11c13d6e9a7d679c440a32c54cc2 Mon Sep 17 00:00:00 2001 From: Skywalkr-dev Date: Fri, 22 May 2026 09:59:45 +0000 Subject: [PATCH] fix: correct lookup for environment variables in cache The current implementation keys the environment cache by the full "NAME=VALUE" string. This causes the generator to treat updates to existing variables as new entries, leading to duplicate environment variables in the final configuration. This change switches the cache key to use only the variable name, ensuring that AddProcessEnv correctly updates existing values instead of appending them. Fixes #798 Signed-off-by: Skywalkr-dev --- generate/generate.go | 1 + 1 file changed, 1 insertion(+) diff --git a/generate/generate.go b/generate/generate.go index 816305f0..886faeba 100644 --- a/generate/generate.go +++ b/generate/generate.go @@ -322,6 +322,7 @@ func NewFromTemplate(r io.Reader) (Generator, error) { func createEnvCacheMap(env []string) map[string]int { envMap := make(map[string]int, len(env)) for i, val := range env { + val, _, _ = strings.Cut(val, "=") envMap[val] = i } return envMap