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

[IPL-5689] Revert the fix for no changes detected when provider default org changes on Registry Modules #1263

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

hashimoon
Copy link
Contributor

@hashimoon hashimoon commented Feb 27, 2024

This fixes a bug that always forced a registry module to always be recreated when a default organization is not provided..

Description

Describe why you're making this change.

Remember to:

Testing plan

  1. Perform
terraform apply

with the below code (fill out your values for identifiers and oauth_token_id):

terraform {
  required_providers {
    tfe = {
      source = "hashicorp/tfe"
      version = "0.49.0"
    }
  }
}
resource "tfe_registry_module" "test-registry-module" {
  vcs_repo {
    display_identifier = "your/display-identifier"
    identifier         = "your/identifier"
    oauth_token_id     = "ot-oauth-token-id"
  }
}
  1. Change the version of the provider to 0.51.0
  2. Perform
terraform init -upgrade
  1. Perform
terraform plan

Expected behavior
Since the resource is not changed but only the version of the provider the resource should not be recreated.

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 testing.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

...

@hashimoon hashimoon requested a review from a team as a code owner February 27, 2024 19:56
…lt org changes PR-1163

This fixes a bug that always forced a registry module to always be recreated when an organization is not present.
@hashimoon hashimoon force-pushed the hashimoon/IPL-5689-recreation-bug branch from a9ac84e to 9d08769 Compare February 27, 2024 21:35
Copy link
Collaborator

@brandonc brandonc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good because the organization attribute in this particular resource is fundamentally different from the others and it was added by mistake. Usually, organization is optional because it can appear in the provider. In this case, it's just optional!

@hashimoon hashimoon merged commit 2a33557 into main Mar 4, 2024
9 checks passed
@hashimoon hashimoon deleted the hashimoon/IPL-5689-recreation-bug branch March 4, 2024 20:11
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.

2 participants