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

bump terraform-plugin-go #611

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

laurenolivia
Copy link
Contributor

@laurenolivia laurenolivia commented Aug 23, 2022

Description

This PR was created to upgrade github.com/hashicorp/terraform-plugin-go v0.5.0 to v0.6.0. A bug was reported, and after investigating the issue, it has been determined that an upgrade resolve the issue.

Remember to:

Testing plan

Config 1 of 2

terraform {
  required_providers {
    tfe = {
      version = "0.33.0"    <---- toggle between "0.31.0"
    }
  }
}

provider "tfe" {
  hostname = "tfcdev-xxxxxx.ngrok.io"
}

data "tfe_outputs" "workspace" {
  organization = "hashicorp"
  workspace    = "test-apply-command"
}

output "output_this" {
  value = data.tfe_outputs.workspace.values.scifi_names
  sensitive = true
}

Config file 2 of 2

terraform {
  cloud {
    organization = "hashicorp"
    hostname = "tfcdev-xxxxxx.ngrok.io"

    workspaces {
      name = "test-apply-command"
    }
  }
}


resource "random_pet" "animal_trio" {
  count = 3
  length = 3
}

output "animal_names" {
  value = random_pet.animal_trio[*].id
}

output "planet_names" {
  value = [null]
}

output "scifi_names" {
  value = toset([null])
}

Phase 1

  1. Config file 2 of 2 should be connected to a workspace in your local dev, with null values (see example)
  2. Run terraform apply

Phase 2

  1. Revert the plugin back to v0.5.0 by running go get github.com/hashicorp/terraform-plugin-go@v0.5.0 -u
  2. Run command: make devoverride, and an env var should be returned to you for dev overrides
  3. Take that command: export TF_CLI_CONFIG_FILE=/Whatever/your/path/looks/like
  4. And paste it wherever your config file 1 of 2 lives
  5. Run terraform init -upgrade after changing the source version in required_providers
  6. Run terraform apply, toggle version and try again
  7. It should fail

Phase 3

  1. Revert the plugin back to v0.5.0 by running go get github.com/hashicorp/terraform-plugin-go@v0.6.0 -u
  2. Run: make devoverride, and an env var should be returned to you for dev overrides
  3. Take that command: export TF_CLI_CONFIG_FILE=/Whatever/your/path/looks/like
  4. And paste it wherever your config file 1 of 2 lives
  5. Run terraform init -upgrade after changing the source version in required_providers
  6. Run terraform apply, toggle version and try again
  7. It should pass

External links

Include any links here that might be helpful for people reviewing your PR. If there are none, feel free to delete this section.

Output from acceptance tests

Please run applicable acceptance tests locally and include the output here. See TESTS.md to learn how to run acceptance tests.

If you are an external contributor, your contribution(s) will first be reviewed before running them against the project's CI pipeline.

$ TESTARGS="-run TestAccTFEWorkspace" make testacc

...

@laurenolivia laurenolivia requested a review from a team as a code owner August 23, 2022 21:16
@laurenolivia laurenolivia linked an issue Aug 23, 2022 that may be closed by this pull request
@laurenolivia laurenolivia force-pushed the laurenolivia/upgrade-terraform-plugin-go branch from e1c72bf to 8ecfe5c Compare August 23, 2022 22:28
@laurenolivia laurenolivia merged commit 4db0fd7 into main Aug 24, 2022
@laurenolivia laurenolivia deleted the laurenolivia/upgrade-terraform-plugin-go branch August 24, 2022 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when getting tfe_outputs with value [null,null,null]
2 participants