hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.25k stars 1.7k forks source link

Disable nodepool autoscaling before deletion #17668

Open nemethloci opened 3 months ago

nemethloci commented 3 months ago

Community Note

Terraform Version

v1.7.4

Affected Resource(s)

google_container_node_pool

Terraform Configuration

Debug Output

No response

Expected Behavior

Nodepool would be deleted without any new nodes being created in the nodepool under deletion

Actual Behavior

Upon deletion of a nodepool one would expect no new nodes to be started int he nodepool under deletion, however as per google support in case autoscaling is enabled on the nodepool, that's what actually should happen.

My proposal is that upon deletion of a nodepool to have autoscaling disabled before the actual delete operation is called. Probably somewhere here: https://github.com/hashicorp/terraform-provider-google/blob/main/google/services/container/resource_container_node_pool.go#L756

Steps to reproduce

  1. terraform apply

Important Factoids

No response

References

https://github.com/hashicorp/terraform-provider-google/issues/17522 Not sure if this is visible for people outside our org, but for reference (or for any google employees): https://console.cloud.google.com/support/cases/detail/v2/50136016?project=rd-platform-k8s-development

b/331217876

ggtisc commented 3 months ago

Hi @nemethloci could you provide the terraform configuration you have to reproduce this issue?

rileykarson commented 3 months ago

This looks like an enhancement rather than a bug- we're interacting with the API correctly, and this is requesting new steps to supplement the interaction.