-
Notifications
You must be signed in to change notification settings - Fork 113
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
remove workspace env var and not set it to an empty string. #388
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 |
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.
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_WORKSPACE
will not exist and avoids the above problem. I have tested this locally with terraform 1.4.5 and it works.