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

Rename `TF_INIT_FLAGS` to `GITLAB_TOFU_INIT_FLAGS`

Changelog: changed
parent f3815f14
No related branches found
No related tags found
No related merge requests found
...@@ -328,7 +328,7 @@ we may make it the default behavior if possible. ...@@ -328,7 +328,7 @@ we may make it the default behavior if possible.
#### Lockfile Handling #### Lockfile Handling
If you commit the Lockfile (`.terraform.lock.hcl`) to your repository If you commit the Lockfile (`.terraform.lock.hcl`) to your repository
we recommend setting either the `TF_INIT_FLAGS` (handled by this component) we recommend setting either the `GITLAB_TOFU_INIT_FLAGS` (handled by this component)
or `TF_CLI_ARGS_init` (handled by OpenTofu directly) to `-lockfile=readonly` or `TF_CLI_ARGS_init` (handled by OpenTofu directly) to `-lockfile=readonly`
to prevent any changes to the lockfile during the pipeline job and with to prevent any changes to the lockfile during the pipeline job and with
that ensuring that OpenTofu really uses the locked dependencies. that ensuring that OpenTofu really uses the locked dependencies.
......
...@@ -343,7 +343,7 @@ we may make it the default behavior if possible. ...@@ -343,7 +343,7 @@ we may make it the default behavior if possible.
#### Lockfile Handling #### Lockfile Handling
If you commit the Lockfile (`.terraform.lock.hcl`) to your repository If you commit the Lockfile (`.terraform.lock.hcl`) to your repository
we recommend setting either the `TF_INIT_FLAGS` (handled by this component) we recommend setting either the `GITLAB_TOFU_INIT_FLAGS` (handled by this component)
or `TF_CLI_ARGS_init` (handled by OpenTofu directly) to `-lockfile=readonly` or `TF_CLI_ARGS_init` (handled by OpenTofu directly) to `-lockfile=readonly`
to prevent any changes to the lockfile during the pipeline job and with to prevent any changes to the lockfile during the pipeline job and with
that ensuring that OpenTofu really uses the locked dependencies. that ensuring that OpenTofu really uses the locked dependencies.
......
...@@ -258,9 +258,9 @@ terraform_init() { ...@@ -258,9 +258,9 @@ terraform_init() {
tf_init_reconfigure_flag='-reconfigure' tf_init_reconfigure_flag='-reconfigure'
fi fi
# We want to allow word splitting here for TF_INIT_FLAGS # We want to allow word splitting here for GITLAB_TOFU_INIT_FLAGS
# shellcheck disable=SC2086 # shellcheck disable=SC2086
tofu "${tf_chdir_opt}" init "${@}" -input=false ${tf_init_reconfigure_flag} ${TF_INIT_FLAGS} \ tofu "${tf_chdir_opt}" init "${@}" -input=false ${tf_init_reconfigure_flag} ${GITLAB_TOFU_INIT_FLAGS} \
1>&2 || $GITLAB_TOFU_IGNORE_INIT_ERRORS 1>&2 || $GITLAB_TOFU_IGNORE_INIT_ERRORS
} }
......
...@@ -35,12 +35,12 @@ teardown() { ...@@ -35,12 +35,12 @@ teardown() {
} }
@test "gitlab-tofu init with environment variable flags" { @test "gitlab-tofu init with environment variable flags" {
export TF_INIT_FLAGS="-get=true -no-color" export GITLAB_TOFU_INIT_FLAGS="-get=true -no-color"
gitlab-tofu init gitlab-tofu init
} }
@test "gitlab-tofu init with args and environment variable flags" { @test "gitlab-tofu init with args and environment variable flags" {
export TF_INIT_FLAGS="-get=true" export GITLAB_TOFU_INIT_FLAGS="-get=true"
gitlab-tofu init -no-color gitlab-tofu init -no-color
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment