You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, mise with the plugins terraform or opentofu will correctly parse the tool version from the required_version directive in the main.tf / main.tofu file.
Both plugins support env vars to change the name of the file to parse (ASDF_HASHICORP_TERRAFORM_VERSION_FILE / ASDF_OPENTOFU_VERSION_FILE) (see i.e. https://github.com/asdf-community/asdf-hashicorp?tab=readme-ov-file#usage):
ASDF_HASHICORP_TERRAFORM_VERSION_FILE: Which .tf-file to examine for version constraints when using the legacy_version_file option in ~/.asdfrc. Defaults to main.tf
But when setting this env var to an existing file containing a required_version directive, mise doesn't parse this file.
To Reproduce
$ mkdir test
mise terraform@1.5.0
$ cd test
mise terraform@1.5.0
$ echo -e "terraform {\n required_version = \"1.7.1\" \n}" > main.tf
mise terraform@1.7.1
$ mise config
Path Plugins
/tmp/test/main.tf terraform
~/.config/mise/config.toml opentofu, terraform
mise terraform@1.7.1
$ mv main.tf versions.tf
mise terraform@1.5.0
$ export ASDF_HASHICORP_TERRAFORM_VERSION_FILE=versions.tf
mise terraform@1.5.0
/tmp/test $ mise config
Path Plugins
~/.config/mise/config.toml opentofu, terraform
mise terraform@1.5.0
Expected behavior
When I export ASDF_HASHICORP_TERRAFORM_VERSION_FILE=versions.tf and have a versions.tf file with a required_version directive, mise should pin the terraform/tofu version to this version.
Describe the bug
Right now, mise with the plugins terraform or opentofu will correctly parse the tool version from the
required_version
directive in themain.tf
/main.tofu
file.Both plugins support env vars to change the name of the file to parse (
ASDF_HASHICORP_TERRAFORM_VERSION_FILE
/ASDF_OPENTOFU_VERSION_FILE
) (see i.e. https://github.com/asdf-community/asdf-hashicorp?tab=readme-ov-file#usage):But when setting this env var to an existing file containing a
required_version
directive, mise doesn't parse this file.To Reproduce
Expected behavior
When I export
ASDF_HASHICORP_TERRAFORM_VERSION_FILE=versions.tf
and have aversions.tf
file with arequired_version
directive, mise should pin the terraform/tofu version to this version.mise doctor
outputThe text was updated successfully, but these errors were encountered: