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

Clarify role of ignoreDelete: true vs applyOnDelete: false #29

Open
asaintsever opened this issue Feb 24, 2021 · 1 comment
Open

Clarify role of ignoreDelete: true vs applyOnDelete: false #29

asaintsever opened this issue Feb 24, 2021 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@asaintsever
Copy link
Contributor

asaintsever commented Feb 24, 2021

Hi,

I am currently testing the operator and I must say that I still struggle to understand the role of the ignoreDelete attribute. By reading the documentation, it looks like that, if I don't want to trigger a terraform -destroy, I should either omit applyOnDelete or set applyOnDelete: false. So I fail to understand why we need another attribute to handle deletion behavior. For e.g., does it make sense to set both applyOnDelete: false and ignoreDelete: true? I would say no (without reading the code in details).

Maybe it is only a naming and description issue but thanks for making it clearer.

@isaaguilar
Copy link
Collaborator

Thanks for your patience. I just got back from a road-trip across the US.

I will update documentation but basically if ignoreDelete is not set as true, when deleting the terraform resource, the Terraform-operator controller will always spin up a destroy job. Then it's up to applyOnDelete to be set to true to automatically run the destroy command.

What happens if applyOnDelete is set to false, the terraform-runner pod will do a destroy-plan, and then wait. See what happens when applyOnDelete is false here: https://github.com/isaaguilar/terraform-operator/blob/master/docs/operator-actions.md#when-apply-is-false.

Finally, the reason that ignoreDelete isn't automatically set as true when applyOnDelete is false is exactly for that case when a user wants to "pause" after a plan and not automatically run the destroy command.

This was a concept I had when originally creating the operator that might be able to hook into another system that can manage the plan/apply.

I hope this helps, but I'll try to document this so it's not as ambiguous.

@isaaguilar isaaguilar added the documentation Improvements or additions to documentation label Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants