Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ignore_destroy attribute/logic #2588

Closed
wants to merge 2 commits into from
Closed

Conversation

JaylonmcShan03
Copy link
Contributor

@JaylonmcShan03 JaylonmcShan03 commented Sep 20, 2024

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_destroy attribute, and I will need document the process accordingly in the provider documentation.

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Tested using a test config on my local machine. When running apply with the attribute set, following terraform destroy. the resource is not deleted, but when adding the attribute after the resource is created, the resource is destroyed.
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

Release Note

Release note for CHANGELOG:

...

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

An option ignore deletion of a resource
2 participants