chore: update terraform to 1.2.1#3243
Merged
Merged
Conversation
AbhineetJain
approved these changes
Jul 27, 2022
| var terraformVersion = version.Must(version.NewVersion("1.2.1")) | ||
| 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")) |
Contributor
There was a problem hiding this comment.
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?
Member
Author
There was a problem hiding this comment.
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?
AbhineetJain
approved these changes
Jul 27, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.