File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ const (
22
22
logPathEnvVar = "TF_LOG_PATH"
23
23
reattachEnvVar = "TF_REATTACH_PROVIDERS"
24
24
appendUserAgentEnvVar = "TF_APPEND_USER_AGENT"
25
+ workspaceEnvVar = "TF_WORKSPACE"
25
26
26
27
varEnvVarPrefix = "TF_VAR_"
27
28
)
@@ -33,6 +34,7 @@ var prohibitedEnvVars = []string{
33
34
logEnvVar ,
34
35
reattachEnvVar ,
35
36
appendUserAgentEnvVar ,
37
+ workspaceEnvVar ,
36
38
}
37
39
38
40
func envMap (environ []string ) map [string ]string {
@@ -105,6 +107,9 @@ func (tf *Terraform) buildEnv(mergeEnv map[string]string) []string {
105
107
// constant automation override env vars
106
108
env [automationEnvVar ] = "1"
107
109
110
+ // force usage of workspace methods for switching
111
+ env [workspaceEnvVar ] = ""
112
+
108
113
return envSlice (env )
109
114
}
110
115
Original file line number Diff line number Diff line change @@ -36,11 +36,12 @@ func TestMergeUserAgent(t *testing.T) {
36
36
37
37
func defaultEnv () []string {
38
38
return []string {
39
+ "CHECKPOINT_DISABLE=" ,
39
40
"TF_APPEND_USER_AGENT=HashiCorp-terraform-exec/" + version .ModuleVersion (),
40
- "TF_LOG=" ,
41
- "TF_LOG_PATH=" ,
42
41
"TF_IN_AUTOMATION=1" ,
43
- "CHECKPOINT_DISABLE=" ,
42
+ "TF_LOG_PATH=" ,
43
+ "TF_LOG=" ,
44
+ "TF_WORKSPACE=" ,
44
45
}
45
46
}
46
47
You can’t perform that action at this time.
0 commit comments