Skip to content
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

helper/resource: Set CHECKPOINT_DISABLE environment variable outside terraform-exec #937

Merged
merged 1 commit into from Apr 12, 2022

Conversation

bflad
Copy link
Member

@bflad bflad commented Apr 12, 2022

Closes #935

When using (tfexec.Terraform).SetEnv(), it will no longer copy os.Environ(). It is also not possible for the code to call tfexec.CleanEnv(os.Environ()) with the additional environment variable as it would strip previously accepted TF_VAR_ environment variables. There are no plans to change this behavior in terraform-exec.

…terraform-exec

Reference: #935

When using `(tfexec.Terraform).SetEnv()`, it will no longer copy `os.Environ()`. It is also not possible for the code to call `tfexec.CleanEnv(os.Environ())` with the additional environment variable as it would strip previously accepted `TF_VAR_` environment variables. There are no plans to change this behavior in terraform-exec.
@bflad bflad added the bug Something isn't working label Apr 12, 2022
@bflad bflad added this to the v2.14.0 milestone Apr 12, 2022
@bflad bflad requested a review from a team as a code owner April 12, 2022 16:09
@bflad bflad merged commit 85b9ee9 into main Apr 12, 2022
@bflad bflad deleted the bflad-no-more-tfexec-setenv branch April 12, 2022 18:08
bflad added a commit that referenced this pull request Apr 12, 2022
bflad added a commit to hashicorp/terraform-provider-corner that referenced this pull request Apr 13, 2022
Reference: hashicorp/terraform-plugin-sdk#935

With github.com/hashicorp/terraform-plugin-sdk/v2@v2.13.0:

```console
$ TF_ACC=1 go test -count=1 -run='TestAccFrameworkResourceUser_TF_VAR_Environment_Variable' -v ./internal/frameworkprovider/
=== RUN   TestAccFrameworkResourceUser_TF_VAR_Environment_Variable
    resource_user_test.go:117: Step 1/1 error: Error running pre-apply refresh: variable "framework_user_name" was required but not supplied
--- FAIL: TestAccFrameworkResourceUser_TF_VAR_Environment_Variable (0.56s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-corner/internal/frameworkprovider       1.324s
FAIL
```

Passes with hashicorp/terraform-plugin-sdk#937.
bflad added a commit to hashicorp/terraform-provider-corner that referenced this pull request Apr 15, 2022
Reference: hashicorp/terraform-plugin-sdk#935

With github.com/hashicorp/terraform-plugin-sdk/v2@v2.13.0:

```console
$ TF_ACC=1 go test -count=1 -run='TestAccFrameworkResourceUser_TF_VAR_Environment_Variable' -v ./internal/frameworkprovider/
=== RUN   TestAccFrameworkResourceUser_TF_VAR_Environment_Variable
    resource_user_test.go:117: Step 1/1 error: Error running pre-apply refresh: variable "framework_user_name" was required but not supplied
--- FAIL: TestAccFrameworkResourceUser_TF_VAR_Environment_Variable (0.56s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-corner/internal/frameworkprovider       1.324s
FAIL
```

Passes with hashicorp/terraform-plugin-sdk#937.
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Environment variables wiped out
2 participants