Skip to content

Commit

Permalink
terraform/exec: Pass through all environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Jun 5, 2020
1 parent b6cda0d commit d4d4c76
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions internal/terraform/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@ import (

var defaultExecTimeout = 30 * time.Second

// Environment variables to pass through to Terraform
var passthroughEnvVars = []string{
// This allows Terraform to find custom-built providers
"HOME", "USER", "USERPROFILE",
// This allows Terraform to create crash log in the desired temp directory
// os.TempDir would otherwise fall back to C:\Windows on Windows
// which has no write permissions for non-admins
"TMPDIR", "TMP", "TEMP",
}
// We pass through all variables, but longer term we'll need to reflect
// that some variables might be workspace/directory specific
// and passing through these may be dangerous once the LS
// starts to execute commands which can mutate the state
var passthroughEnvVars = os.Environ()

// cmdCtxFunc allows mocking of Terraform in tests while retaining
// ability to pass context for timeout/cancellation
Expand Down

0 comments on commit d4d4c76

Please sign in to comment.