Skip to content

version check problems, misleading error, opentofu #582

Description

@angulion

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions