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

Fix bug: diff being detected for source_repo_repository even when there are no changes #6886

Conversation

modular-magician
Copy link
Collaborator

This patch fixes a bug in source_repo_repository where a diff was always being generated for the TypeSet field pubsub_configs since its Set hashing function was not accounting for the fact that pubsub_configs[].topic can contain either a topic's name or relative path.

To reproduce, apply the following Terraform configuration, then run terraform plan right after. Notice how terraform plan detects a diff even when nothing was actually changed.

provider "google" {
  project = "my-project-test"
}

resource "google_pubsub_topic" "topic" {
  name = "my-topic-test"
}

resource "google_sourcerepo_repository" "repo" {
  name             = "my-repo-test"
  pubsub_configs {
    topic           = google_pubsub_topic.topic.name
    message_format  = "JSON"
  }
}

Release Note Template for Downstream PRs (will be copied)

sourcerepo: fixed perma-diff in `google_sourcerepo_repository`

Derived from GoogleCloudPlatform/magic-modules#3786

…re are no changes (hashicorp#3786)

This patch fixes a bug in source_repo_repository where a diff was always
being generated for the TypeSet field `pubsub_configs` since its Set
hashing function was not accounting for the fact that
`pubsub_configs[].topic` can contain either a topic's name or relative
path.

Signed-off-by: Modular Magician <magic-modules@google.com>
@ghost ghost added the size/xs label Jul 29, 2020
@modular-magician modular-magician merged commit 1d4ebf5 into hashicorp:master Jul 29, 2020
dboshardy pushed a commit to dboshardy/terraform-provider-google that referenced this pull request Aug 3, 2020
* upstream/master:
  Add a random string to ad directory so tests can be run in parallel (hashicorp#3802) (hashicorp#6905)
  Set context early on in LoadAndValidate to prevent NPE (hashicorp#3800) (hashicorp#6903)
  Add tests for DICOM store pubsub topic removal. (hashicorp#3442) (hashicorp#6893)
  Bump Bigtable version from 1.1.0 to 1.5.0 (hashicorp#6890)
  Fix colon in doc notes (hashicorp#3796) (hashicorp#6888)
  Fix bug: diff being detected for source_repo_repository even when there are no changes (hashicorp#3786) (hashicorp#6886)
  Use proper prefix inside router_interface test (hashicorp#3795) (hashicorp#6883)
  Update Bigtable Num of Clusters Block Docs (hashicorp#3792) (hashicorp#6881)
@ghost
Copy link

ghost commented Aug 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Aug 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant