-
-
Notifications
You must be signed in to change notification settings - Fork 3
Hotfix | Do not set backend key on tf init --skip-validation #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,8 +22,7 @@ | |
| @click.group() | ||
| @pass_state | ||
| def tofu(state): | ||
| """Run OpenTofu commands in a custom containerized environment that provides extra functionality when interacting | ||
| with your cloud provider such as handling multi factor authentication for you. | ||
| """Run OpenTofu commands in the context of the current project. | ||
| All tofu subcommands that receive extra args will pass the given strings as is to their corresponding OpenTofu | ||
| counterparts in the container. For example as in `leverage tofu apply -auto-approve` or | ||
| `leverage tofu init -reconfigure` | ||
|
|
@@ -34,8 +33,7 @@ def tofu(state): | |
| @click.group() | ||
| @pass_state | ||
| def terraform(state): | ||
| """Run Terraform commands in a custom containerized environment that provides extra functionality when interacting | ||
| with your cloud provider such as handling multi factor authentication for you. | ||
| """Run Terraform commands in the context of the current project. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The docstring has been updated to reflect that Terraform commands are run in the context of the current project rather than a containerized environment. However, the subsequent line still mentions passing arguments to "counterparts in the container". Please update this to remove the reference to the container to keep the documentation consistent and accurate. |
||
| All terraform subcommands that receive extra args will pass the given strings as is to their corresponding Terraform | ||
| counterparts in the container. For example as in `leverage terraform apply -auto-approve` or | ||
| `leverage terraform init -reconfigure` | ||
|
|
@@ -272,7 +270,7 @@ def invoke_for_all_commands(paths, layers, command, *args: Sequence[str], skip_v | |
| validate_for_all_commands(layer, skip_validation=skip_validation) | ||
|
|
||
| # set the s3 key | ||
| if not get_backend_key(layer / "config.tf"): | ||
| if not skip_validation and not get_backend_key(layer / "config.tf"): | ||
| backend_key_base = f"{paths.cwd.relative_to(paths.root_dir).as_posix()}/terraform.tfstate" | ||
| backend_key = backend_key_base.replace("/base-", "/").replace("/tools-", "/") | ||
| set_backend_key(layer / "config.tf", backend_key) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring has been updated to reflect that OpenTofu commands are run in the context of the current project rather than a containerized environment. However, the subsequent line still mentions passing arguments to "counterparts in the container". Please update this to remove the reference to the container to keep the documentation consistent and accurate.