-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow additional specifiers in terraform's required_version
other than =
e.g. ~>
and >
#1217
Comments
Is there a reason why this was not implemented? Looking at the code, it seems reasonably straightforward to do so. Just need to get the list of all available terraform versions, which can be pulled from https://api.github.com/repos/hashicorp/terraform/tags |
Or, slightly more hackily, could parse the HTML returned from ${TFDownloadURL}/terraform to get all the version numbers. But, that presumes that whatever URL is configured works similar to https://releases.hashicorp.com/terraform and provides a link tree. |
I think this was likely not implemented because it makes the behaviour non-deterministic or because it was too difficult. I didn't implement it though so I can't say for sure :) |
@llamahunter so you would want atlantis to download all terraform versions that match your non-exact constraint? It can't use that info to set a default version to use, though. |
I would want it to download the most recently available version that matches the version constraint. |
Per the semver spec (which Terraform follows), the version with the greatest precedence shall be selected. If a user wants to use a specific version of Terraform they can indicate that by using a The Terraform documentation specifically covers the Version Constraint Syntax and Version Constraint Behavior |
Ah my mistake, looks like this PR is in review but just taking some time to get out the door. I just need to be patient 😄 |
@jlestrada Feel free to give the PR a review if you have the cycles. I'm sure that would help it land more quickly |
Will #1266 also read from |
@mcaulifn It uses the Terraform code to do the ingest and interpretation of versions, so the behaviour will be identical to that of Terraform |
what's the status of this? The PR that was purportedly going to fix this (#1266) was abandoned. |
It seems that PR #1266 was abandoned @llamahunter and the branch was also deleted very recently. FWIW, in recent versions of terraform such as 0.15.x and 1.x, we do not have to worry so much about tfstate since the tfstate is backwards compatible. For terraform root modules that have been upgraded to 1.x, I use the default atlantis version which is the latest terraform version and I use a I'd be in favor of another PR (or the same PR if the branch was undeleted and rebased) that would allow more than just One downside of this proposed change is that if you were to set the constraint to If the change to support |
required_version
other than '='
required_version
other than '='required_version
other than =
e.g. ~>
and `>~
required_version
other than =
e.g. ~>
and `>~required_version
other than =
e.g. ~>
and >
Currently, it appears that the code in project_command_builder.go only accepts terraform.required_version specifications that exactly specify a single version, rather than a range or other version constraint. Seems odd to have this limited behavior, as atlantis is built to support a wide range of terraform versions. It seems that the version constraints should be interpreted and the latest matching terraform version selected.
Also, the silent failure of the current approach is misleading.
The text was updated successfully, but these errors were encountered: