Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenTofu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
components
OpenTofu
Commits
4ac18238
Unverified
Commit
4ac18238
authored
7 months ago
by
Timo Furrer
Browse files
Options
Downloads
Patches
Plain Diff
Rename `terraform_authenticate_private_registry` function to `tofu_authenticate_private_registry`
Changelog: changed
parent
30b74af0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gitlab-tofu.sh
+2
-2
2 additions, 2 deletions
src/gitlab-tofu.sh
tests/unit/gitlab-tofu.bats
+3
-3
3 additions, 3 deletions
tests/unit/gitlab-tofu.bats
with
5 additions
and
5 deletions
src/gitlab-tofu.sh
+
2
−
2
View file @
4ac18238
...
@@ -227,7 +227,7 @@ if [ -z "${TF_CLI_CONFIG_FILE}" ] && [ -f "${default_tf_cli_config_file}" ]; the
...
@@ -227,7 +227,7 @@ if [ -z "${TF_CLI_CONFIG_FILE}" ] && [ -f "${default_tf_cli_config_file}" ]; the
fi
fi
t
erraform
_authenticate_private_registry
()
{
t
ofu
_authenticate_private_registry
()
{
# From Terraform 1.2.0 and later (or all versions of OpenTofu), we can use TF_TOKEN_your_domain_name to authenticate to registry.
# From Terraform 1.2.0 and later (or all versions of OpenTofu), we can use TF_TOKEN_your_domain_name to authenticate to registry.
# The credential environment variable has the following requirements:
# The credential environment variable has the following requirements:
# - Domain names containing non-ASCII characters are converted to their punycode equivalent with an ACE prefix
# - Domain names containing non-ASCII characters are converted to their punycode equivalent with an ACE prefix
...
@@ -269,7 +269,7 @@ tofu_init() {
...
@@ -269,7 +269,7 @@ tofu_init() {
# and helper functions exposed by this script.
# and helper functions exposed by this script.
if
[
$sourced
-eq
0
]
;
then
if
[
$sourced
-eq
0
]
;
then
# Authenticate to private registry
# Authenticate to private registry
t
erraform
_authenticate_private_registry
t
ofu
_authenticate_private_registry
var_file_args
=
""
var_file_args
=
""
if
[
-n
"
${
GITLAB_TOFU_VAR_FILE
}
"
]
;
then
if
[
-n
"
${
GITLAB_TOFU_VAR_FILE
}
"
]
;
then
...
...
This diff is collapsed.
Click to expand it.
tests/unit/gitlab-tofu.bats
+
3
−
3
View file @
4ac18238
...
@@ -139,7 +139,7 @@ EOF
...
@@ -139,7 +139,7 @@ EOF
@test "gitlab-tofu no wrap" {
@test "gitlab-tofu no wrap" {
# NOTE: running `gitlab-tofu apply` wouldn't fail
# NOTE: running `gitlab-tofu apply` wouldn't fail
# because of the implicit `t
erraform
init`.
# because of the implicit `t
ofu
init`.
run gitlab-tofu -- apply -no-color
run gitlab-tofu -- apply -no-color
assert_failure
assert_failure
assert_output --partial 'Error: Backend initialization required, please run "tofu init"'
assert_output --partial 'Error: Backend initialization required, please run "tofu init"'
...
@@ -206,7 +206,7 @@ set -x
...
@@ -206,7 +206,7 @@ set -x
export CI_SERVER_HOST=gitlab.example.com
export CI_SERVER_HOST=gitlab.example.com
export TF_TOKEN_gitlab_example_com=mysecrettoken
export TF_TOKEN_gitlab_example_com=mysecrettoken
. $(which gitlab-tofu)
. $(which gitlab-tofu)
t
erraform
_authenticate_private_registry
t
ofu
_authenticate_private_registry
test "$TF_TOKEN_gitlab_example_com" = "mysecrettoken"
test "$TF_TOKEN_gitlab_example_com" = "mysecrettoken"
EOF
EOF
...
@@ -224,7 +224,7 @@ set -x
...
@@ -224,7 +224,7 @@ set -x
export CI_SERVER_HOST=gitlab.example.com
export CI_SERVER_HOST=gitlab.example.com
export TF_TOKEN_gitlab_example_com=mysecrettoken
export TF_TOKEN_gitlab_example_com=mysecrettoken
. $(which gitlab-tofu)
. $(which gitlab-tofu)
t
erraform
_authenticate_private_registry
t
ofu
_authenticate_private_registry
test "$TF_TOKEN_gitlab_example_com" = "mysecrettoken"
test "$TF_TOKEN_gitlab_example_com" = "mysecrettoken"
EOF
EOF
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment