Skip to content
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 parsing required_version using constraints #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hoshsadiq
Copy link

This commit adds functionality to allow parsing the required_version
directly from the .tf file. This allows for fully configuring the
terraform version via the official terraform version management syntax.

The logic was codified from the Terraform Docs on Version
Constraints
.

This commit adds functionality to allow parsing the `required_version`
directly from the `.tf` file. This allows for fully configuring the
terraform version via the official terraform version management syntax.

The logic was codified from the [Terraform Docs on Version
Constraints](https://www.terraform.io/language/expressions/version-constraints).
@hoshsadiq hoshsadiq requested a review from a team as a code owner August 14, 2022 11:29
Comment on lines +238 to +240
# todo doing this on every dir change is expensive. What is a good alternative?
local all_versions
IFS=" " read -r -a all_versions <<<"$("${__dirname}/list-all")"
Copy link
Author

Choose a reason for hiding this comment

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

Not really sure what the best approach is here. This is pretty expensive to do every single time since it's a network request. Also, in case there is no network, this will most definitely fail.

Perhaps what should be done here is only check local versions if offline (though, how do we check if a user is offline)? And when they are online, perhaps, we can cache the results when list-all is run.

Any thoughts?

@hoshsadiq
Copy link
Author

In addition, I think it would be good if I can get some people to try and break it, to see if any bugs might crop up.

@kenchan
Copy link

kenchan commented Feb 15, 2024

I'm also stuck with the same issue. I'd like it to be merged, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants