flux-iac / tofu-controller

A GitOps OpenTofu and Terraform controller for Flux
https://flux-iac.github.io/tofu-controller/
Apache License 2.0
1.31k stars 137 forks source link

switch hardcoded value for `terraform init -upgrade` to `false` (#1) #1468

Closed daniel-ciaglia closed 1 month ago

daniel-ciaglia commented 1 month ago

During the turmoil around Hashicorp's aws provider v5.71.0 we came up with the idea of pinning the provider via .terraform.lock.hcl which we injected through the FileMappings feature of tofu-controller. Sadly this approach was sabotaged by this little boolean.

The boolean is equivalent to terraform init -upgrade

For us, as we do NOT usually ship .terraform.lock.hcl, this flag is not important and we would prefer it to be false.

Ideally this flag should be configurable but it requires a change in the kind:Terraform CRD.

akselleirv commented 1 month ago

Hi @daniel-ciaglia, would you like to contribute this change?

daniel-ciaglia commented 1 month ago

Yes, hence the PR ;-)

akselleirv commented 1 month ago

This change would be considered a breaking change and thus nothing that we can accept, but you can add this functionality by adding the option to the CRD.

daniel-ciaglia commented 1 month ago

Yeah, I understand that. I will see to extend the PR to include the mentioned CRD change. Thanks for checking so far ;-)

daniel-ciaglia commented 1 month ago

Closing for now