Skip to content

Permadiff on monitoring_config.enable_components due to list ordering #2584

@pfuhrmann

Description

@pfuhrmann

Description

monitoring_config.enable_components causes a permanent diff on every terraform plan because the GCP API returns the components in a different order than Terraform sends them.

Steps to reproduce

  1. Create a GKE cluster with monitoring_enabled_components = ["DEPLOYMENT", "HPA", "POD", "STATEFULSET", "STORAGE", "SYSTEM_COMPONENTS"]
  2. Run terraform apply — succeeds
  3. Run terraform plan — shows a diff reordering the list

Expected behavior

No diff after a successful apply.

Actual behavior

~ enable_components = [
    - "SYSTEM_COMPONENTS",
    - "STORAGE",
    + "DEPLOYMENT",
      "HPA",
      "POD",
    - "DEPLOYMENT",
      "STATEFULSET",
    + "STORAGE",
    + "SYSTEM_COMPONENTS",
  ]

Suggested fix

Use sort() on enable_components in cluster.tf line 115, or convert to TypeSet in the provider schema.

Versions

  • terraform-google-kubernetes-engine v44.0.0
  • hashicorp/google ~> 7.0
  • Terraform >= 1.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions