terramate-io / terramate

Terramate CLI is an open-source Infrastructure as Code (IaC) Orchestration and Code Generation tool for Terraform, OpenTofu and Terragrunt.
https://terramate.io
Mozilla Public License 2.0
3.12k stars 86 forks source link

[BUG] runtime removes all characters from env value after `=` #1710

Closed 1mr closed 1 month ago

1mr commented 1 month ago

Describe the bug If the env value contains =, then all characters after = will be removed in terramate.config.run.env

To Reproduce

  1. Source data
    
    env | grep KEY
    KEY1=adasd=
    KEY2=adasd=adasd
    KEY3=adasd==
    KEY4=a=adasd

terramate { config { run { env { KEY1 = env.KEY1 KEY2 = env.KEY2 KEY3 = env.KEY3 KEY4 = env.KEY4 } } } }


2. Run command `tm debug show runtime-env`
3. See modified values

stack "/terraform/test": KEY1=adasd KEY2=adasd KEY3=adasd KEY4=a TF_PLUGIN_CACHE_DIR=~/.terraform.d/plugin-cache


**Expected behavior**
Do not change env values and handle the `=` character in env values correctly.

tm debug show runtime-env

stack "/terraform/test": KEY1=adasd= KEY2=adasd= KEY3=adasd=adasd KEY4=a=adasd TF_PLUGIN_CACHE_DIR=~/.terraform.d/plugin-cache



**Log Output**
-

**Environment (please complete the following information):**
 - OS: macOS
 - OS Version [14.4.1]
 - Git Version [2.39.3] (git --version)
 - Terramate Version [0.8.3] (terramate --version)
i4ki commented 1 month ago

Hi @1mr

Thanks for reporting this. It's fixed here https://github.com/terramate-io/terramate/pull/1711 and will be included in the next release. I will let you know when released.