Skip to content

fix: keep '=' in env var values passed to terragrunt get_env - #2757

Open
sarankumar1325 wants to merge 1 commit into
diggerhq:developfrom
sarankumar1325:fix/tac-getenvs-equals
Open

sarankumar1325 wants to merge 1 commit into
diggerhq:developfrom
sarankumar1325:fix/tac-getenvs-equals

Conversation

@sarankumar1325

Copy link
Copy Markdown

Summary

getEnvs() in libs/digger_config/terragrunt/tac/generate.go builds the Env map that is handed to terragrunt's options when Digger generates projects from terragrunt configs. It split each os.Environ() entry with strings.Split(env, "=") and stored only results[1], so any value that itself contains = was cut at the first = in the value:

FOO=token=abc==   ->   Env["FOO"] == "token"

get_env("FOO") in a terragrunt file evaluated through that options object then saw the truncated value (base64 padding, URLs with query strings, k=v lists are common examples).

This change splits on the first = only (strings.Cut), which is how the environment is defined, and skips entries without one instead of indexing past the slice.

Tests

  • New TestGetEnvsKeepsEqualsInValues (fails on develop with token vs token=abc==, passes with the fix).
  • GOWORK=off go test ./digger_config/... in libs/ passes; go vet clean.

🧠 Ai UsageDetails (if applicable):

This PR was written with AI assistance (Grok Bot): it found the bug, wrote the fix and test, and ran the tests. I reviewed the change.

getEnvs split each os.Environ entry on every '=' and kept only the
second piece, so a value such as "token=abc==" reached terragrunt's
get_env as "token". Split on the first '=' only.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant