flux-iac / tofu-controller

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

Question about which CLI to use and how to get the binary of the latest version #597

Closed aristapimenta closed 1 year ago

aristapimenta commented 1 year ago

Hi @chanwit,

I noticed that the gitops CLI has lots of overlapping commands with tfctl. Which one is the recommended CLI?

Also, I use curl -s https://fluxcd.io/install.sh | sudo bash (from here) in combination with flux install --export on a GitHub Workflow that runs on a schedule for periodically checking for Flux upgrades and opening pull requests when a new version is available, i.e. when flux install --export > gotk-components.yaml produces a diff. I want to do the same for tf-controller. Right now we have the v0.15.0-rc.1 release/tag but it doesn't contain the compiled tfctl binary, therefore I'm kinda stuck with the tf-controller Helm chart to get the latest version right now.

It would be really cool if tf-controller integrated well, for example, with this binary manager: https://github.com/marcosnils/bin So when I run bin install https://github.com/weaveworks/tf-controller I get the binary of the latest version. But right now this is what happens:

➜  terraform git:(main) bin install https://github.com/weaveworks/tf-controller           
   • Getting latest release for weaveworks/tf-controller
   ⨯ command failed            error=repository weaveworks/tf-controller does not have releases
➜  terraform git:(main) 

But it does work for the gitops CLI:

➜  terraform git:(main) bin install https://github.com/weaveworks/weave-gitops
   • Getting latest release for weaveworks/weave-gitops
   • Starting download of https://api.github.com/repos/weaveworks/weave-gitops/releases/assets/107631273
36.48 MiB / 36.48 MiB [--------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 13.53 MiB p/s 3s

Multiple matches found, please select one:

 [1] LICENSE
 [2] README.md
 [3] gitops
 Select an option: 3
   • Copying for gitops@v0.23.0 into /home/pimenta/.local/bin/gitops
   • Done installing gitops v0.23.0
➜  terraform git:(main)

This or something like curl -s https://fluxcd.io/install.sh | sudo bash would be amazing!

chanwit commented 1 year ago

Hi @aristapimenta Sorry for late reply.

tfctl is deprecated and will be served as a development tool only. We're moving towards integrating all Terraform commands into Weave GitOps (gitops) CLI. Thing's still a bit messy at the moment, so please stay tuned.

aristapimenta commented 1 year ago

Thanks @chanwit!