remove workspace env var and not set it to an empty string.#388
remove workspace env var and not set it to an empty string.#388kmoe merged 1 commit intohashicorp:mainfrom
Conversation
|
Some additional context: the current behavior (explicitly setting terraform {
cloud {
organization = "MyOrg"
workspaces {
tags = [
"owner:my-team",
"project:my-project",
]
}
}
}
Normally you'd use The bug here is if By removing the See the official HashiCorp help article Selecting a workspace when running Terraform in automation |
kmoe
left a comment
There was a problem hiding this comment.
This may well be a bug in the Terraform automation plugin - have let the team know. In any case this is the intended behaviour for terraform-exec. Thanks!
Setting the environment variable to an empty string confuses the terraform binary as seen below: ``` TF_WORKSPACE= terraform init -no-color -input=false -get=false -upgrade=false -backend=false Error: Terraform Cloud returned an unexpected error invalid value for workspace ``` With this patch the `TF_WORKSPACE` will not exist and avoids the above problem. I have tested this locally with terraform 1.4.5 and it works.
|
@kmoe I fixed the tests can you help re-trigger the builds, thanks! |
|
@kmoe looks like all checks have passed, how do we get this merged and released? |
|
Any chance to get a release out with this change? Thanks! |
Setting the environment variable to an empty string confuses the terraform binary as seen below:
With this patch the
TF_WORKSPACEwill not exist and avoids the above problem. I have tested this locally with terraform 1.4.5 and it works.