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

Marked terraform provider imports as v3 #4309

Merged

Conversation

melinath
Copy link
Member

@melinath melinath commented Dec 10, 2020

Related to GoogleCloudPlatform/terraform-validator#158. TLDR we need to do semantic versioning for the providers so that they can be imported as libraries (specifically by terraform-validator.) There are just a couple of spots in magic-modules that reference a package version, so we need to update those; otherwise, go will try to install v1 of the package alongside v3.

This has two companion PRs that update the module name for the two providers:

This will not break people using the providers, because those are specially built binaries rather than terraform using the package as a library.

Release Note Template for Downstream PRs (will be copied)


@google-cla google-cla bot added the cla: yes label Dec 10, 2020
@melinath melinath requested a review from c2thorn December 10, 2020 17:41
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 1 insertion(+), 1 deletion(-))
Terraform Beta: Diff ( 1 file changed, 1 insertion(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=162552"

@@ -4,7 +4,7 @@ package google
import (
"encoding/json"
"fmt"
"github.com/hashicorp/terraform-provider-google-beta/google-beta"
"github.com/hashicorp/terraform-provider-google-beta/v3/google-beta"
Copy link
Member

Choose a reason for hiding this comment

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

Am I understanding correctly that this was referring to an older version of the beta provider because we weren't following semantic versioning?

Copy link
Member Author

@melinath melinath Dec 10, 2020

Choose a reason for hiding this comment

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

yes, that's correct. It was working nonetheless because it was all local to the module and had the same path as the module, but once the downstream PRs are merged the module name will include the v3 and any references to the old module name will result in version 1.20 being downloaded and used by those imports.

@melinath melinath merged commit 59e1163 into GoogleCloudPlatform:master Dec 10, 2020
@melinath melinath deleted the tfv-158-semantic-versioning branch December 10, 2020 19:00
@melinath melinath restored the tfv-158-semantic-versioning branch December 10, 2020 19:00
@melinath melinath deleted the tfv-158-semantic-versioning branch December 10, 2020 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants