hashicorp / terraform-provider-kubernetes

Terraform Kubernetes provider
https://www.terraform.io/docs/providers/kubernetes/
Mozilla Public License 2.0
1.6k stars 979 forks source link

Adding ignore_destroy attribute/logic #2588

Closed JaylonmcShan03 closed 2 months ago

JaylonmcShan03 commented 2 months ago

Description

Fixes #2188 This update introduces the ignore_destroy attribute to the Kubernetes provider. When set to true, it ensures that the resource will only be applied and will not be deleted during a Terraform destroy operation.

Important Note: The ignore_destroy attribute only takes effect if the resource is applied with the attribute set to true prior to running a destroy operation. If the attribute is set immediately before the destroy command, it will not have any impact. This limitation arises because, at destroy time, the provider does not have access to the resource's configuration, as nothing is being created. As such, the attribute must be applied during the resource creation phase for it to take effect during subsequent destroy operations.

I believe this sort of edge case should be considered when using the ignore_destroyattribute, and I will need document the process accordingly in the provider documentation.

Acceptance tests

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

Release Note

Release note for CHANGELOG:

...

References

Community Note