Closed kvendingoldo closed 3 months ago
That could seem surprising, however the regexp match. There is several way to get the last 1.1 patch : use a more selective regexp (tenv tf install latest:^1\.1\.
) or use version constraint (tenv tf install "~> 1.1"
)
Agree, probably we have to add info about such cases to readme. Will do that
@kvendingoldo Does it mean we should use something like this latest:^1.1.
( an additional dot ) instead of latest:^1.1
?
@dvaumoron tried tenv tf install latest:^1\.1\.
, but this regex works a little bit strange:
Use of regexp is discouraged, try version constraint instead
Fetching all releases information from https://releases.hashicorp.com/terraform/index.json
Found compatible version remotely : 1.10.0-alpha20240606
Terraform 1.10.0-alpha20240606 already installed
Additional strange behavior: ➜ ~ tenv tf install "~> 1.1"
Fetching all releases information from https://releases.hashicorp.com/terraform/index.json
Found compatible version remotely : 1.8.5
Installing Terraform 1.8.5
Fetching release information from https://releases.hashicorp.com/terraform/1.8.5/index.json
Downloading https://releases.hashicorp.com/terraform/1.8.5/terraform_1.8.5_darwin_amd64.zip
Downloading https://releases.hashicorp.com/terraform/1.8.5/terraform_1.8.5_SHA256SUMS
Downloading https://releases.hashicorp.com/terraform/1.8.5/terraform_1.8.5_SHA256SUMS.sig
Downloading https://www.hashicorp.com/.well-known/pgp-key.txt
Sorry, it's not strange, tenv tf install "~> 1.1.0"
works fine, but regex does not work.
ok, regex tenv tf install latest:^1\.1\..-
works, but it install 1.1.0, not 1.1.9.
@MageshSrinivasulu @flav1972 you can install the required version via the tenv: tenv tf install latest:^1\.1\..-
or tenv tf install latest:^1.1.9
tfenv (not tested with tenv) works fine with latest:^1\.1\.
$ cat .terraform-version
latest:^1\.1\.
$ tfenv install
Installing Terraform v1.1.9
hmm, for golang we have to find another regex, because latest:^1\.1\.
does not work
Sorry, it's not strange,
tenv tf install "~> 1.1.0"
works fine, but regex does not work.
That's my fault, my example was erroneous, with ~>
the last part can be maxed.
hmm, for golang we have to find another regex, because latest:^1.1. does not work
That's weird, i will take a look on that (probably this week end)
hmm, for golang we have to find another regex, because
latest:^1\.1\.
does not work
What have you tried ? It seem to work well (tested on Windows).
$ tenv tf install latest:^1\.1\.
Use of regexp is discouraged, try version constraint instead
Fetching all releases information from https://releases.hashicorp.com/terraform/index.json
Found compatible version remotely : 1.1.9
Installing Terraform 1.1.9
Fetching release information from https://releases.hashicorp.com/terraform/1.1.9/index.json
Downloading https://releases.hashicorp.com/terraform/1.1.9/terraform_1.1.9_windows_amd64.zip
Downloading https://releases.hashicorp.com/terraform/1.1.9/terraform_1.1.9_SHA256SUMS
Downloading https://releases.hashicorp.com/terraform/1.1.9/terraform_1.1.9_SHA256SUMS.sig
Downloading https://www.hashicorp.com/.well-known/pgp-key.txt
Installation of Terraform 1.1.9 successful
@kvendingoldo Does it mean we should use something like this
latest:^1.1.
( an additional dot ) instead oflatest:^1.1
?
a dot in a regexp capture every character, to capture only the dot character you need to escape it in the regexp with a backslash
What have you tried ? It seem to work well (tested on Windows).
tested again on linux with bash...
you need to use quote to avoid interpretration from bash which lead to the strange behavior (i.e. use tenv tf install "latest:^1\.1\."
)
single quote work too tenv tf install 'latest:^1\.1\.'
Describe the bug the command
tenv tf install latest:^1.1
install v.1.10 instead of 1.1Additional context Found the bug here https://github.com/tfutils/tfenv/issues/432