-
Notifications
You must be signed in to change notification settings - Fork 67
Does not work with terraform -chdir or modules #246
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
Description
Describe the bug
It seems tenv only scans terraform files in the current directory.
If all such files are in a tf subdirectory say, with a tf/.terraform-version of min-required and tf/providers.tf having terraform { required_version = "~> 1.5" }, then:
$terraform -chdir=tf version
Resolved version from .terraform-version : min-required
Scan project to find IAC files
No Terraform version requirement found in project files, fallback to latest strategy
[...]
(note also that that requires .terraform-version in $PWD - it won't find that from the -chdir either)
Even without -chdir, if there's additionally a tf/module/providers.tf with a terraform { required_version = "~> 1.9" } say, then:
$cd tf && terraform version
Resolved version from [..]/.terraform-version : min-required
Scan project to find IAC files
No compatible version found locally, search a remote one...
Fetching all releases information from https://releases.hashicorp.com/terraform/index.json
Found compatible version remotely : 1.5.0
Installing Terraform 1.5.0
ignoring the 1.9 requirement.
To Reproduce
Described above
Expected behavior
1.9.0 installed in both cases, with or without -chdir, 1.5.0 is not compatible.
Screenshots
N/A
Environment (please complete the following information):
- OS: [e.g. iOS] macOS (iOS?!)
tofuenvtenv version [e.g. 0.8.0] 3.1.0
Additional context
N/A
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested