GalleyBytes / terraform-operator

A Kubernetes CRD to handle terraform operations
http://tf.galleybytes.com
Apache License 2.0
364 stars 47 forks source link

Edit while in delete/destroy triggers plan/apply #147

Closed davhdavh closed 1 year ago

davhdavh commented 1 year ago

If you edit the Terraform resource while it is in deleting state it will try to plan and apply instead of delete-plan and delete-apply. Editing the cm and deleting the delete-plan pod does not update tf files. Deleting the Terraform resource again, will actually delete the children leaving it in a state where it can no longer execute any plans. This makes it pretty impossible to fix a broken tf that didn't properly support destroy.

isaaguilar commented 1 year ago

Wow, thanks for pointing this out. I do admit I don't do a lot of deletes so I'll try and replicate this and see what can be fixed.

davhdavh commented 1 year ago

Easy way to replicate is to define a variable 'for' plan and apply but not the delete variants. Tf will complain the required variable isnt defined when deleting.