Closed bryanhiestand closed 6 months ago
Just want to chime in to say these changes look good and are hopefully merged with master
soon.
Actually, better solution might be to change line 117 in that file, where the rest of the hacks for old versions are. Note it does not take into account version 0.12.30 and 0.12.31, so the new line should be
"${version}" =~ 0\.12\.(([0-9]|[1-3][0-9]))$ ||
Actually, better solution might be to change line 117 in that file, where the rest of the hacks for old versions are. Note it does not take into account version 0.12.30 and 0.12.31, so the new line should be
"${version}" =~ 0\.12\.(([0-9]|[1-3][0-9]))$ ||
That would make this code simpler! Unlike darwin arm64, it looks like there are linux arm64 builds for 0.11.15, 0.12.30, and 0.13.5. So I don't think we can change that.
The regexes currently in master (from #351, but not yet released) fix all cases where tfenv cannot install because arm64 is unavailable. However, they occasionally force tfenv to install the amd64 binary for some of the >1.0.2 versions.
First,
0\..+$
matches any value containing0.
, including versions with arm64 builds (e.g.1.0.3
).The
1\.0\.0|1$
regex would also match1.5.0-beta1
(but not1.5.0-beta2
),1.10.1
, or anything else that starts with1.
, contains a0
, and then ends with a1
. I believe this regex was intended to be written as^(1\.0\.0|1)$
or^1\.0\.0$|^1$
. It seems more readable to just use^1\.0\.[0-1]$
. I couldn't find any-beta
or-rc
releases of1.0.0
or1.0.1
, so this should be safe.You can test this behavior with some bash
The new regex seems to fix all of these cases:
You can also test this against all versions of terraform tfenv sees:
They all look correct to me