Skip to content

chore: update terraform to 1.2.1 #3243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 27, 2022
Merged

chore: update terraform to 1.2.1 #3243

merged 2 commits into from
Jul 27, 2022

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Jul 27, 2022

This commit updates the embedded Terraform to version 1.2.1 and updates the max Terraform version.
It also modfies the version check logic to allow terraform version equal to max.

For a list of changes, see Terraform 1.2.1 Changelog.

I tested locally with the docker provisioner and it was able to spin up and delete a workspace just fine.

Fixes #1777.

@johnstcn johnstcn requested a review from a team July 27, 2022 09:41
@johnstcn johnstcn marked this pull request as ready for review July 27, 2022 09:41
@johnstcn johnstcn self-assigned this Jul 27, 2022
var minTerraformVersion = version.Must(version.NewVersion("1.1.0"))
var maxTerraformVersion = version.Must(version.NewVersion("1.2.0"))
var maxTerraformVersion = version.Must(version.NewVersion("1.2.1"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the logic in line 70, we are checking that the installed version should be strictly less than the max version. This would throw an error for 1.2.1 and then install 1.2.1 again. The idea behind min and max range was to allow the same minor version. Maybe we can update the range to 1.2.0 <= version < 1.3.0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nice catch. I don't know about you, but "max" to me implies that the maximum is still allowed.
How about we change the logic on line 70 to

version.LessThan(minTerraformVersion) || version.GreaterThan(maxTerraformVersion)

Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can do that!

@johnstcn johnstcn requested a review from a team July 27, 2022 15:17
@johnstcn johnstcn merged commit 6377f17 into main Jul 27, 2022
@johnstcn johnstcn deleted the cj/gh-1777/update-terraform branch July 27, 2022 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update embedded terraform to version 1.2.1
2 participants