Fix bug preventing removal of vcs_repo on workspaces #173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #91
This PR fixes a bug where tfe_workspace resources with a VCS repo set weren't updating properly when the VCS repo was removed from the Terraform config.
Testing plan
Before fix:
terraform init
with the following config:terraform version
and make sureprovider.tfe
is 0.16.1terraform apply
to create a new organization, oauth_client, and workspace connected to a vcs_repo. This should succeed.vcs_repo
from your config and runterraform plan
vcs_repo
, will be removed:terraform apply
. This should succeed.vcs_repo
hasn't been removed. If you check the workspace Settings > Version Control settings in the UI, you should see that your workspace is still connected to VCS.terraform plan
again. This should tell you that it is going to try to remove thevcs_repo
again.Before moving on to the next section:
terraform destroy
..terraform
directory.terraform-provider-tfe
from this branch and copy it to your~/.terraform.d/plugins
directory.After fix:
vcs_repo
config back in and runterraform init
.terraform version
and make sureprovider.tfe
is unversioned.terraform apply
to create a new organization, oauth_client, and workspace connected to a vcs_repo. This should succeed.vcs_repo
from your config and runterraform plan
vcs_repo
, will be removed:terraform apply
. This should succeed.vcs_repo
has been set to[]
. If you check the workspace Settings > Version Control settings in the UI, you should see that your workspace is no longer connected to VCS.If you'd like to run the acceptance tests locally, you'll need to add two new environment variables,
GITHUB_WORKSPACE_IDENTIFIER
andGITHUB_WORKSPACE_BRANCH
. Instructions for adding these variables and setting up the repository for them are in the README.External links
Output from acceptance tests