Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version check problems, misleading error, opentofu #582

Open
angulion opened this issue Dec 20, 2024 · 1 comment
Open

version check problems, misleading error, opentofu #582

angulion opened this issue Dec 20, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@angulion
Copy link

While i know aztfexport is "azure terraform export", it is also true that most linux distributions now ship with opentofu ( /usr/bin/tofu ) instead.
Like a couple previous issue-reports where version check failed because it was 1.6.3-dev, in my case I have tofu symlinked to terraform (because of aztfexport) and the check likely fails because it says:

OpenTofu v1.8.7
on linux_amd64

instead of Terraform , even if they are functionality wise identical.

Please do one of:

  • Remove the whole check, version <0.12 is likely nowhere to be found anymore.
  • Add a --version-ignore flag so one can skip the check at own risk
  • If must, check for "OpenTofu" as well as for "Terraform" in aztfexport/internal/meta/tfinstall_find.go

At the very least, have a error message that states what the actual error is (product, version?), because in all these 3 issues now the error aztfexport (below) has given is just misleading - terraform has been in the path. Especially since it is not mentioned that aztfexport actually checks for product/version.

Misleading error:

> whereis terraform
terraform: /usr/bin/terraform
> aztfexport query True|less -X 
  
   Microsoft Azure Export for Terraform 
  
  ⣽  Initializing...  
   Microsoft Azure Export for Terraform 
  
  error finding a terraform exectuable: unable to find, install, or build from 1 sources: 1 error occurred:
        * terraform: executable file not found in $PATH  

(Had less in pipe to prevent aztfexport from clearing screen)

Additionally, config could have a terraform_executabe setting where one could specify from where aztfexport should run terraform/tofu.

@magodo
Copy link
Collaborator

magodo commented Dec 20, 2024

We haven't been investigating to opentofu at this moment. Whilst I recognize there are more distributions come with opentofu, supporting it can make user's life easier. @stemaMSFT WDYT?

@magodo magodo added the enhancement New feature or request label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants