terraform-google-kubernetes-engine icon indicating copy to clipboard operation
terraform-google-kubernetes-engine copied to clipboard

Diff shown when running `terraform apply` twice with the same config

Open ronilichtman opened this issue 4 years ago • 1 comments

When running the terraform apply twice on the same config we see a diff.

The config:

module "example_workload_identity" {
  source      = "terraform-google-modules/kubernetes-engine/google//modules/workload-identity"
  name        = "example"
  gcp_sa_name = "example-svc"
  namespace   = "default"
  project_id  = local.project
  roles = [
    "roles/monitoring.metricWriter",
  ]
}

The diff:

Terraform detected the following changes made outside of Terraform since the
last "terraform apply":

  # module.example_workload_identity.kubernetes_service_account.main[0] has been changed
  ~ resource "kubernetes_service_account" "main" {
        id                              = "default/example"
        # (2 unchanged attributes hidden)

      ~ metadata {
          + labels           = {}
            name             = "example"
            # (5 unchanged attributes hidden)
        }
    }

ronilichtman avatar Sep 01 '21 14:09 ronilichtman

i think this might be an upstream issue, since we don't touch labels at all and this shouldn't cause a permadiff.

It looks like you reported the same issue there: https://github.com/hashicorp/terraform-provider-kubernetes/issues/1394

morgante avatar Sep 01 '21 17:09 morgante