tfutils / tfenv

Terraform version manager
MIT License
4.48k stars 454 forks source link

v2.2.3: Cannot install anything below v1.0.2 terraform, cURL 403 error #323

Closed snypelife closed 2 years ago

snypelife commented 2 years ago

Specs

OS: macOS 12.1 CPU: M1 Pro ARM64

Expected

To install any arm64 version of terraform, to work with the M1 Mac.

Actual

Attempting to install anything below v1.0.2 of terraform results in a 403 error. Possible duplicate https://github.com/tfutils/tfenv/issues/319 ?

image

Workaround

By using TFENV_ARCH=amd64 I can get it to install, but that doesn't seem right given the arch?

Notes

Version 2.2.2 of tfenv did not have this issue. Or at least I was unable to reproduce it with 2.2.2.

snypelife commented 2 years ago

Tried additional v1 versions, encountered some errors.

image
worzel666 commented 2 years ago

If you browse the directories in your browser you should be able to see that Terraform began to be built for arm64 as of 1.0.2. I believe the previous version of tfenv would previously have erroneously set the TFENV_ARCH to amd64 if you hadn’t set it yourself. The binary would have been present at the constructed URL and no error would have been returned. The behaviour you are seeing is actually correct!

snypelife commented 2 years ago

I see what you're saying. So in order to be able to use those previous versions I have to use the TFENV_ARCH variable now to force installing the amd64 version as that is the only available option for those prior versions of Terraform (pre 1.0.2).

worzel666 commented 2 years ago

That's exactly it :) As this is correct behaviour, I'm going to close this issue.