tofu-controller icon indicating copy to clipboard operation
tofu-controller copied to clipboard

Hanging deletion after creating Terraform resource in namespace without ServiceAccount

Open artem-nefedov opened this issue 1 year ago • 0 comments

When you create a Terraform resource in a namespace without tf-runner ServiceAccount, attempting to delete it will hang indefinitely. You have to manually remove finalizer "finalizers.tf.contrib.fluxcd.io" to unblock deletion.

Meanwhile, controller will continuously report the same logs:

{"level":"error","ts":"2022-08-16T14:54:56.381Z","logger":"controller.terraform","msg":"unable to lookup or create runner","reconciler group":"infra.contrib.fluxcd.io","reconciler kind":"Terraform","name":"vpc","namespace":"default","error":"pods \"vpc-tf-runner\" is forbidden: error looking up service account default/tf-runner: serviceaccount \"tf-runner\" not found"}
{"level":"error","ts":"2022-08-16T14:54:56.382Z","logger":"controller.terraform","msg":"Reconciler error","reconciler group":"infra.contrib.fluxcd.io","reconciler kind":"Terraform","name":"vpc","namespace":"default","error":"pods \"vpc-tf-runner\" is forbidden: error looking up service account default/tf-runner: serviceaccount \"tf-runner\" not found"}

Controller version: v0.12.0-rc.1

interval: 1m0s (in case that is important)

artem-nefedov avatar Aug 16 '22 14:08 artem-nefedov