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

Set default TerraformVersion #52

Merged
merged 1 commit into from
Sep 27, 2019
Merged

Conversation

appilon
Copy link
Contributor

@appilon appilon commented Sep 26, 2019

if the provider is served over the 0.12 protocol it will have a TerraformVersion set. If it is serving the old protocol it will be unset. This is to avoid a piece of boilerplate from repeating over and over in provider ConfigureFuncs, and ensure a consistent special designation of 0.11+compatible, implying it was TF 0.10/0.11 (0.11 compatible/protocol 4).

I originally wanted to try and set this up in the protocol 4 parts of the code... but I couldn't track it down and plumbing it through might be a pain. The risk with this implementation is it feels awkward to mutate the provider struct at this point, are we sure we never want to access this variable before Configure is invoked? I'm not a lifecycle/architecture expert yet.

in Configure implementation if unset
@appilon appilon requested review from a team September 26, 2019 02:31
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

It seems to be working (tested with 0.11 + AWS provider). I can't remember why I haven't done that in core. 🤔

@appilon appilon merged commit 65e5eac into master Sep 27, 2019
@appilon appilon deleted the appilon/default-terraform-version branch September 27, 2019 16:03
@apparentlymart
Copy link
Member

I believe we decided to leave this unset for older versions so that in principle the provider could differentiate an unknown version from a known one, but this special sigil value that would never be generated by a real version of Terraform can serve that purpose too, as long as all the consumers know that if they see this string it could be Terraform 0.10.

@ghost
Copy link

ghost commented Oct 28, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants