Skip to content

fix: wrap API-unordered TypeList attrs in toset() to prevent perpetual diffs#2607

Open
cblecker wants to merge 1 commit into
terraform-google-modules:mainfrom
cblecker:fix/toset-perpetual-plan-diffs
Open

fix: wrap API-unordered TypeList attrs in toset() to prevent perpetual diffs#2607
cblecker wants to merge 1 commit into
terraform-google-modules:mainfrom
cblecker:fix/toset-perpetual-plan-diffs

Conversation

@cblecker

Copy link
Copy Markdown

Summary

  • Several GKE resource attributes are modeled as TypeList in the Terraform provider, but the GKE API returns items in arbitrary order. This causes perpetual no-op diffs on every terraform plan.
  • Wraps each affected value in toset() so Terraform treats them as order-insensitive, eliminating the spurious diffs.
  • Edits the autogen template (autogen/main/cluster.tf.tmpl) and regenerates all module cluster.tf files, plus hand-edits the three non-generated gke module files.

Affected attributes

Attribute Provider source
monitoring_config.enable_components resource_container_cluster.go
logging_config.enable_components resource_container_cluster.go
notification_config.filter.event_type resource_container_cluster.go
node_config.tags node_config.go
node_pool_auto_config.network_tags.tags resource_container_cluster.go
cluster_autoscaling.auto_provisioning_defaults.oauth_scopes resource_container_cluster.go

Attributes already TypeSet in the provider (no change needed): node_config.oauth_scopes, enable_k8s_beta_apis.enabled_apis.

Test plan

  • Verify terraform validate passes against an example configuration
  • Verify terraform plan no longer shows perpetual diffs for the affected attributes
  • Confirm make generate produces no additional changes beyond those in this PR

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates various GKE cluster and node pool Terraform configurations to wrap list-based attributes—such as enable_components, oauth_scopes, tags, and event_type—with the toset() function. This ensures these attributes are treated as sets, preventing potential ordering issues or duplicate values. As there are no review comments provided, I have no feedback to offer.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@cblecker cblecker force-pushed the fix/toset-perpetual-plan-diffs branch from 1c1cb95 to 67df17f Compare June 29, 2026 19:50
…l diffs

Several GKE resource attributes are modeled as TypeList in the
Terraform provider but the GKE API returns items in arbitrary order,
causing perpetual no-op diffs on every plan. Wrap each value in
toset() so Terraform treats them as order-insensitive.

Affected attributes:
- monitoring_config.enable_components
- logging_config.enable_components
- notification_config.filter.event_type
- node_config.tags
- node_pool_auto_config.network_tags.tags
- cluster_autoscaling.auto_provisioning_defaults.oauth_scopes

Assisted-by: Claude:claude-opus-4-6
@cblecker cblecker force-pushed the fix/toset-perpetual-plan-diffs branch from 67df17f to aae2782 Compare July 7, 2026 05:12
@cblecker

Copy link
Copy Markdown
Author

@apeabody sorry for the direct ping, but I'm wondering what the next steps might be to get this reviewed. thank you!

@apeabody

Copy link
Copy Markdown
Contributor

/gcbrun

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.

2 participants