Skip to content
Snippets Groups Projects
Commit 5a44d366 authored by Timo Furrer's avatar Timo Furrer
Browse files

Merge branch 'remove-ff-auto-urlencode-state-name' into 'main'

Remove `TF_FF_AUTO_URLENCODE_STATE_NAME` feature flag

See merge request components/opentofu!187
parents 67a8ff85 300f345e
No related branches found
No related tags found
No related merge requests found
......@@ -11,9 +11,7 @@ fi
# =============
# Below are a bunch of variables that we use as "feature flags".
if [ -z "$TF_FF_AUTO_URLENCODE_STATE_NAME" ]; then
TF_FF_AUTO_URLENCODE_STATE_NAME=true
fi
# There are no feature flags at the moment.
# Helpers
......@@ -78,11 +76,8 @@ fi
# If TF_ADDRESS is unset but TF_STATE_NAME is provided, then default to GitLab backend in current project
if [ -n "${TF_STATE_NAME}" ] && [ -z "${TF_ADDRESS}" ]; then
# auto url-encode TF_STATE_NAME when FF is enabled
if $TF_FF_AUTO_URLENCODE_STATE_NAME; then
# auto url-encode TF_STATE_NAME
TF_STATE_NAME="$(jq -rn --arg x "${TF_STATE_NAME}" '$x|@uri')"
fi
TF_ADDRESS="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${TF_STATE_NAME}"
fi
......
......@@ -195,21 +195,6 @@ EOF
$SHELL test.sh
}
# bats test_tags=source
@test "gitlab-tofu source state name auto urlencode FF disabled" {
test -n "$SHELL"
cat <<'EOF' > test.sh
set -x
export TF_FF_AUTO_URLENCODE_STATE_NAME=false
export TF_STATE_NAME=production/europe
. $(which gitlab-tofu)
test "$TF_STATE_NAME" = "production/europe"
EOF
$SHELL test.sh
}
# bats test_tags=source
@test "gitlab-tofu source init with prepared registry token" {
test -n "$SHELL"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment