Open asaintsever opened 3 years ago
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.
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 aterraform -destroy
, I should either omitapplyOnDelete
or setapplyOnDelete: false
. So I fail to understand why we need another attribute to handle deletion behavior. For e.g., does it make sense to set bothapplyOnDelete: false
andignoreDelete: 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.