Open JeanFred opened 2 years ago
Yes, this is quite strange :
$ export TFENV_TERRAFORM_VERSION=min-required
$ ls
# empty dir
$ tfenv use 1.0.2
Failure to resolve version from 1.0.2
$ cd myapp
# terraform min required : 1.0.3
$ tfenv use 1.0.2
Switching default version to v1.0.3
Default version (when not overridden by .terraform-version or TFENV_TERRAFORM_VERSION) is now: 1.0.3
I was thinking that TFENV_TERRAFORM_VERSION would be used ONLY when I don't specify a version in command line.
I have now tried the
min-required
feature that recently shipped with #335 (after testing the one in #305).It does not seem to work for the use case I described at https://github.com/tfutils/tfenv/pull/305#issuecomment-979135096= and my mixed-version code base.
TFENV_TERRAFORM_VERSION=min-required
, then that firstterraform --version
call fails with [1]305 ended up implementing a graceful fallback on the next detection method. Would something similar be possible here?
(As said in that comment, perhaps my use-case is somewhat specific ; and I can see how automatic fallbacks can be confusing).
[1] Logs
[2] Logs