asdf-hashicorp icon indicating copy to clipboard operation
asdf-hashicorp copied to clipboard

Useless message: "FATAL: Found legacy version file 'main.tf' with unsupported required version constraint expression"

Open mjreed-wbd opened this issue 2 years ago • 3 comments

I appreciate that the plugin tries to determine the version to run based on the terraform code, but if it's not going to parse constraints that are valid to TF, that's no help.

It only displays the message when I don't have a "local" or "shell" version configured via asdf itself, but I do have one selected globally. And it's clearly not a "FATAL" condition, since it proceeds to run that version after printing the message out.

Would rather just get rid of the message.

mjreed-wbd avatar Oct 17 '22 18:10 mjreed-wbd

You can suppress it by changing the configuration file as follows.

~/.asdfrc

legacy_version_file = no

swallowtail62 avatar Nov 29 '22 05:11 swallowtail62

Unfortunately I have that setting enabled to work with https://github.com/asdf-vm/asdf-nodejs

Would it be possible to create a way to disable that message? If I deployed this across my teams, it would cause some support calls from confused developers.

aclarknexient avatar Apr 15 '23 13:04 aclarknexient

An alternative is to use rtx with a configuration file that looks like this

# ~/.config/rtx/config.toml
[settings]
legacy_version_file_disable_tools = ["terraform"]

to selectively disable this for Terraform.

adamroyjones avatar Aug 29 '23 08:08 adamroyjones