From 09bc436910e7558daa06742f7cc8b99bbcee8a4d Mon Sep 17 00:00:00 2001 From: Richard Towers Date: Sat, 6 Feb 2021 16:05:27 +0000 Subject: [PATCH] Use a consistent env var for TF_WORKSPACE 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: https://github.com/terraform-linters/tflint-plugin-sdk/pull/99#discussion_r563246414 As per the docs here: https://www.terraform.io/docs/cli/config/environment-variables.html#tf_workspace --- helper/runner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper/runner.go b/helper/runner.go index 7bc255e..41428c5 100644 --- a/helper/runner.go +++ b/helper/runner.go @@ -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" }