FYI: <https://github.com/hashicorp/terraform/issue...
# atlantis-contributors
l
I'm not sure if there's anything for atlantis to do but wait
I'm still trying to understand what's going on
s
Atlantis needs to change a go library which is used to download tf binaries
r
Seems like we can do a couple things. 1. The fix a. Long term solution: Use the
hc-install
library that
radeksimko
mentioned
b. (hack) Modify our current installation to have a slight change for terraform versions after
1.8.1
2. Alternatives a. Use opentofu b. Create a block list of versions for opentofu/terraform c. Create a max version to download versions for opentofu/terraform
s
and a bit of a code around it probably
Also super short-term fix can be to disable
--tf-download
by default?
r
Idk if we want to change the default as many tf users depend on that… but users can certainly modify it in their configuration
I closed the duplicate issues and pinned this issue as it was the first https://github.com/runatlantis/atlantis/issues/4471
s
Hard to depend on something which is totally broken atm πŸ™‚
But sure, I understand that it is itself can be a breaking change
r
I have maybe 1500 root dirs where the default terraform is set to 0.11, the versions range from 0.11 to 1.x and they all depend on the
release_version
unless they use the default which is 0.11. Changing the default of tf-download would be a breaking change for many of my root dirs.
I’d rather just softlink
terraform1.8.2
to
terraform1.8.1
and call it a day
oh… well there we go. that’s the easiest hack lol
s
tomorrow there can be 1.8.3 πŸ™‚
so it should probably be slightly more aggressive than that
r
its not a long term solution lol
its a hack, as i described.
s
But I think Atlantis should do some quick-fix release, which will disallow downloading >= 1.8.1?
πŸ‘ 1
r
yes that would be nice. Please put in a PR πŸ™‚
completely agree tho, that would work for now
d
Atlantis should be best-effort. I like Stas' approach
I don't like the existing idea that we provide a docker image with binaries. Users are able to use Atlantis as a base image and deploy their own binaries. The auto-download feature is a nice to have, but as shown its brittle and should be regarded as "best-effort". Otherwise, build your own container image with your own pipeline.
βž• 1
It's too much for Atlantis and our team of contributors to handle every use case, its a distraction from the Go code and "product" we provide, the Go binary
r
Atlantis should be best-effort. I like Stas’ approach
so short-term you want to default tf-download to disable and release a new version ?
d
which will disallow downloading >= 1.8.1?
don't disable the whole feature, just gate the errenous release
r
yes, agreed.
πŸ‘ 1
d
if users want >= 1.8.1, they can add the binary to the image themselves
since we're kinda blocked on a 0.28.0 release atm, we can PR a fix and backport it to a 0.27.x release
πŸ‘ 2
s
My idea is to add one more constraint here - https://github.com/runatlantis/atlantis/blob/main/server/core/terraform/terraform_client.go#L340 - and hardcode it to
<= 1.8.1
. This will mean that new version will satisfy both
required_version
from terraform and our new limitation. It will also mean that there will be an error if
required_version
is set to
>= 1.8.2
or anything like that. What do you think?
πŸ‘ 1
l
fwiw I'm in the process of doing basically the equivalent in repos I own ^^
Copy code
-  required_version = ">= v1.5.5"
+  required_version = ">= v1.5.5, < 1.8.2"
and it is working as expected
πŸ‘ 1
s
In our case, we just turned off tf-download, because we don't use that version in our custom workflow anyway πŸ™‚
so everyone uses tf version we bake into our custom image
πŸ‘ 1
I've conjured https://github.com/runatlantis/atlantis/pull/4474, and I'm almost confident in this change πŸ™‚ It would be nice if someone can maybe test this on a real atlantis maybe? Also, people who for some reason would have
>= 1.8.2
in their
required_version
may get a weird error, but I'm pretty sure there are a couple of issues/misunderstanding on how to use those just-in-time terraform downloads anyway
I'm fully open to any comments and suggestions πŸ™Œ
r
I’m almost confident in this change
You can merge the branch in your fork and your fork will automatically build a release image
Then you can test the release image directly from your fork and verify it works correctly
s
That's true. I can also build and test locally, and I will do it tomorrow
πŸ‘ 1
l
I was able to test, worked as expected
πŸ™ 1
πŸŽ‰ 2
r
Thanks for the PR, the automated tests, and the manual test!
πŸŽ‰ 3
πŸ™Œ 1
l
As follow up from yesterday's incident I opened https://github.com/runatlantis/atlantis/issues/4483 to discuss long term solutions