https://www.runatlantis.io/ logo
Title
c

Chastity Blackwell

03/15/2023, 3:27 PM
Hrm. I thought Atlantis respected
.terraform-version
files
w

wby

03/15/2023, 3:29 PM
I haven’t heard of those. is that a tfenv thing?
It will follow version constraints if included
c

Chastity Blackwell

03/15/2023, 3:29 PM
Yeah.
Yeah, I know that.
I just thought I remembered it sticking with .terraform-version files too in the past. I am probably remembering wrong though.
w

wby

03/15/2023, 3:30 PM
don’t see it in the codebase, fwiw
but maybe could be possible with some kind of hook that runs before everything else?
c

Chastity Blackwell

03/15/2023, 3:31 PM
yeah, probably
I know in the past I used a customized Atlantis image too, so that wouldn't be surprising.
w

wby

03/15/2023, 3:32 PM
https://www.runatlantis.io/docs/terraform-versions.html#via-terraform-config doesn’t mention it There’s a discussion here https://github.com/runatlantis/atlantis/issues/629 but it’s pretty old (2020). one person said they were using a custom workflow to use tfenv, but also ran into race conditions
c

Chastity Blackwell

03/15/2023, 3:32 PM
I got a surprise update to 1.4 so that's what I was a little worried about.
w

wby

03/15/2023, 3:33 PM
there are a few quirks to watch out for w/ 1.4
c

Chastity Blackwell

03/15/2023, 3:33 PM
Yeah, that's why I was a little annoyed
😆 1
w

wby

03/15/2023, 3:34 PM
I knew one of them was coming, cause I’d somehow come across the issue and was following it. the change in plan output (and how it interacted with Atlantis) was a big surprise to me tho
a kind of nasty in-between hack (vs. adding the requirement in the tf code) would be to have a preflight workflow that inserts the terraform required version based on your
.terraform-version
file? if there’s already a
terraform {}
block, might have to insert into it vs. just generating the whole block tho.
c

Chastity Blackwell

03/15/2023, 3:38 PM
That's a little messier than I'd like. 😕 I will have to see if I can find something though.
w

wby

03/15/2023, 3:38 PM
do you already have something that’s overriding
ATLANTIS_DEFAULT_TF_VERSION
?
c

Chastity Blackwell

03/15/2023, 3:41 PM
No...I wasn't setting that. But that might just be the best plan anywya.
w

wby

03/15/2023, 3:49 PM
ah, yeah, if you’re not otherwise influencing the version, and want the default version to be the same everywhere, that should work and will for sure be the easiest fix! We have that set as kind of an extra backstop (though occasionally forget to update it)
c

Chastity Blackwell

03/15/2023, 3:55 PM
Hrm. It doesn't look like that will let me pin to say 1.3 instead of 1.3.7 or whatever though?
w

wby

03/15/2023, 4:31 PM
that’s true, but seems unlikely that there would be any 1.3.x releases past 1.3.9?
and the fix for the weird 1 empty line plan thing should be solved by 1.4.1 hopefully 🤞
c

Chastity Blackwell

03/15/2023, 4:46 PM
1.4.1 is out 🙂
w

wby

03/15/2023, 4:48 PM
woot!
I never learn the lesson of waiting a week or two for a new minor version to settle
(we pin everything and use renovate to update the versions, but then I’m always excited to get the new hotness and approve it right away)
c

Chastity Blackwell

03/15/2023, 4:49 PM
Yeah, that's the wise move 🙂
w

wby

03/15/2023, 4:51 PM
the whole lockfile thing is another whole long running ball of wax. I love a lot of things about Hashicorp / Terraform, but there are times where their “Hashi-way or the highway” annoys the @#$@#$ out of me
c

Chastity Blackwell

03/15/2023, 4:52 PM
Yup 😕
w

wby

03/15/2023, 4:53 PM
I’d grudgingly use it / check it in in the way that they want if it actually worked properly all the time, but it doesn’t.
I also had a 1 line PR to remove the extra
\n
after
terraform validate
output… took them a year to look at it, then say they were making bigger / broader changes, then do nothing, then come back to it and say they were rejecting it and also that it wasn’t clear that an extra space was a problem 🙄 Ok, end of totally unrelated rant… get off my lawn.
w

wby

03/15/2023, 9:39 PM
@RB thanks! I haven’t yet verified that 1.4.1 fixes the “no output” thing, but it should. Assuming it does, you may want to update the pinned issue to reflect that, or at least mention that it’s 1.4.0 specifically?
r

RB

03/15/2023, 9:40 PM
I'll definitely update it but first we need to verify that 1.4.1 works as expected to resolve the issue you're referring to
w

wby

03/15/2023, 10:09 PM
I hadn’t tested, but I will right now
yup, works. whether there should also be a workaround for the empty output thing is a separate question, I guess
👍 1
I commented in #3200, but seems to (as expected) behave the same as it did before
❤️ 1