padok-team / burrito

🌯 Burrito is a TACoS 🌮
https://padok-team.github.io/burrito
Apache License 2.0
245 stars 10 forks source link

Handle Terraform failure in runner #148

Closed corrieriluca closed 1 year ago

corrieriluca commented 1 year ago

Currently a Terraform plan/apply failure in the runner does not result in an error.

It puts the runner.terraform.padok.cloud/plan-date or runner.terraform.padok.cloud/apply-date, resulting in the controller to believe that a plan was successfully generated for this layer (or apply successfully applied).

This code snippet should be adapted:

https://github.com/padok-team/burrito/blob/6f45c0b61ae2d674f37c75ff8baa76eb4fa317f7/internal/runner/runner.go#L83-L96

Also, and as stated in #27, runner should exit with a code greater than 0 when Terraform/Terragrunt fails inside the pod.