Skip to content
Snippets Groups Projects
Unverified Commit 300f345e authored by Timo Furrer's avatar Timo Furrer
Browse files

Remove `TF_FF_AUTO_URLENCODE_STATE_NAME` feature flag

This feature flag is now always enabled.

Changelog: removed
parent 67a8ff85
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
TF_STATE_NAME="$(jq -rn --arg x "${TF_STATE_NAME}" '$x|@uri')"
fi
# auto url-encode TF_STATE_NAME
TF_STATE_NAME="$(jq -rn --arg x "${TF_STATE_NAME}" '$x|@uri')"
TF_ADDRESS="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${TF_STATE_NAME}"
fi
......
......@@ -84,13 +84,13 @@ EOF
@test "gitlab-tofu plan" {
export TF_PLAN_CACHE="test-plan.cache"
gitlab-tofu plan
if [ ! -f "$TF_ROOT/$TF_PLAN_CACHE" ]; then
if [ ! -f "$TF_ROOT/$TF_PLAN_CACHE" ]; then
echo "expected to find a plan.cache file"
exit 1
fi
gitlab-tofu plan-json
if [ ! -f "$TF_ROOT/plan.json" ]; then
if [ ! -f "$TF_ROOT/plan.json" ]; then
echo "expected to find a plan.json file"
exit 1
fi
......@@ -111,28 +111,28 @@ EOF
@test "gitlab-tofu validate without implicit init" {
export TF_IMPLICIT_INIT=false
run ! gitlab-tofu validate -no-color
assert_output --partial 'This module is not yet installed'
}
@test "gitlab-tofu plan without implicit init" {
export TF_IMPLICIT_INIT=false
run ! gitlab-tofu plan -no-color
assert_output --partial 'Error: Backend initialization required'
}
@test "gitlab-tofu apply without implicit init" {
export TF_IMPLICIT_INIT=false
run ! gitlab-tofu apply -no-color
assert_output --partial 'Error: Failed to load '
}
@test "gitlab-tofu destroy without implicit init" {
export TF_IMPLICIT_INIT=false
run ! gitlab-tofu destroy -no-color
assert_output --partial 'Error: Backend initialization required'
}
......@@ -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