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 #2316

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 51fd478 into hashicorp:master Jul 29, 2020
@modular-magician modular-magician deleted the downstream-pr-acb73ca2ac7a60241cd5d5fb4c96ee741b102c89 branch November 16, 2024 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant