-
Notifications
You must be signed in to change notification settings - Fork 91
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
Framework Migration #791
Framework Migration #791
Conversation
41662e7
to
3530173
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work so far! Just a few suggestions
|
||
providers := []func() tfprotov5.ProviderServer{ | ||
providerserver.NewProtocol5( | ||
linode.CreateFrameworkProvider(version.ProviderVersion), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgarber-akamai Do you think this is the right way to get version number of the provider?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zliang-akamai Yep! The ProviderVersion
is injected into the version
package at build-time.
See: https://github.com/linode/terraform-provider-linode/blob/dev/.goreleaser.yml#L13
/acctest sha=3addf8af2acb3f50a5850ca31a7d9d235fddc45d pkg=linode/... |
No idea if that will work but it's worth a try ^ |
@lgarber-akamai |
/acctest sha=3addf8af2acb3f50a5850ca31a7d9d235fddc45d pkg=linode/token |
Can you add some description to this PR? It's a large change, will be difficult to understand and maintain in the future without any context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like all relevant tests are passing 🎉
Thank you! I just added the description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! Test are passing locally 🥳
…asource for metal_ssh_key (#406) This PR is a first step towards migration from TF SDKv2 to the plugin Framework. It's along way, and Hashicorp documents it at [0]. We want to have both types of providers exist in the repo until we can totally migrate to framework. We need to use "muxing" [1]. I base this on the continuous migration of the Linode TF provider [2]. [3] is a first PR where they introduced the framework provider and migrated `token` resource to the framework format. For our case, I selected `metal_ssh_key` resource and datasource to migrate here, because those are simple resource types. [0] https://developer.hashicorp.com/terraform/plugin/framework/migrating [1] https://developer.hashicorp.com/terraform/plugin/framework/migrating/mux [2] https://github.com/linode/terraform-provider-linode [3] linode/terraform-provider-linode#791 Towards #365
📝 Description
Migrating Terraform SDK v2 provider to be Terraform Framework Provider.
Creating mux server for supporting both SDK v2 provider and the framework provider concurrently.
Migrate resource
token
to Framework provider's resource implementation as an example for the future migration work.✔️ How to Test
Test the migrated resource:
make PKG_NAME="linode/token" testacc
Test everything else:
make testacc