From 735ac3a538e2d1c88eaafdd739995e747c1b29fc Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Mon, 5 Jun 2023 10:42:38 +0300 Subject: [PATCH] Fix how load_env splits values with `=` sign (#3535) * Fix how load_env splits with equals sign * changelog --- CHANGELOG.md | 1 + devops/scripts/load_env.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efeff29f6..232c7c402 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ENHANCEMENTS: BUG FIXES: * Nexus might fail to deploy due to wrong identity used in key-vault extension ([#3492](https://github.com/microsoft/AzureTRE/issues/3492)) * Airlock notifier needs SCM basic-auth enabled to install ([#3509](https://github.com/microsoft/AzureTRE/issues/3509)) +* `load_env.sh` is able to use an equal `=` sign in values ([#3535](https://github.com/microsoft/AzureTRE/issues/3535)) COMPONENTS: diff --git a/devops/scripts/load_env.sh b/devops/scripts/load_env.sh index f03327c49..4706ea3af 100755 --- a/devops/scripts/load_env.sh +++ b/devops/scripts/load_env.sh @@ -20,8 +20,8 @@ else while read -r line do # split the line into name/value - name=$(echo "$line" | cut -d= -f1) - value=$(echo "$line" | cut -d= -f2) + IFS='=' read -r name value <<< "$line" + # Create the Terraform var name form, i.e. convert FOO=BAR to TF_VAR_foo=BAR tf_name="TF_VAR_$(echo "$name" | tr '[:upper:]' '[:lower:]')"