Skip to content

google_artifact_registry_repository: Fix perma-diff in maven_config #9109

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

Conversation

modular-magician
Copy link
Collaborator

The maven_config field is immutable, but also optional. This PR adds a diff suppress to equate missing, empty and default configs.

Example:

resource "google_artifact_registry_repository" "repo" {
  project       = local.project_id
  repository_id = "test-maven-repo"
  format        = "MAVEN"
  location      = "us"
  description   = "Test Maven Repository"
}
resource "google_artifact_registry_repository" "repo" {
  project       = local.project_id
  repository_id = "test-maven-repo"
  format        = "MAVEN"
  location      = "us"
  description   = "Test Maven Repository"
  maven_config { }
}
resource "google_artifact_registry_repository" "repo" {
  project       = local.project_id
  repository_id = "test-maven-repo"
  format        = "MAVEN"
  location      = "us"
  description   = "Test Maven Repository"
  maven_config {
    allow_snapshot_overwrites = false
  }
}

These should all represent the same configuration, but instead cause perma-diffs when moving from one to any other.

Release Note Template for Downstream PRs (will be copied)

artifactregistry: fixed perma-diff in `google_artifact_registry_repository`

b/376134092

Derived from GoogleCloudPlatform/magic-modules#12190

… (#12190)

[upstream:c5023de0d6808cba61407f190cc4f2bbce00bb62]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician requested a review from a team as a code owner January 22, 2025 00:28
@modular-magician modular-magician merged commit 5f92f81 into hashicorp:main Jan 22, 2025
4 checks passed
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.

1 participant