Skip to content

Commit

Permalink
Use a consistent env var for TF_WORKSPACE (#101)
Browse files Browse the repository at this point in the history
This is just used in the test runner, but we may as well be consistent
with the variable used in terraform and mainline tflint.

As suggested here: #99 (comment)
As per the docs here: https://www.terraform.io/docs/cli/config/environment-variables.html#tf_workspace
  • Loading branch information
richardTowers authored Feb 7, 2021
1 parent eb30218 commit dace1c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helper/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (r *Runner) EvaluateExpr(expr hcl.Expression, ret interface{}, wantTy *cty.
for _, variable := range r.tfconfig.Module.Variables {
variables[variable.Name] = variable.Default
}
workspace, success := os.LookupEnv("TERRAFORM_WORKSPACE")
workspace, success := os.LookupEnv("TF_WORKSPACE")
if !success {
workspace = "default"
}
Expand Down

0 comments on commit dace1c8

Please sign in to comment.