-
Notifications
You must be signed in to change notification settings - Fork 95
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
providerserver: Implement native protocol version 5 support #368
Conversation
Reference: #158 This enables provider developers to natively create and serve framework providers on protocol version 5, which is compatible with Terraform CLI 0.12 and later. For provider developers that are using terraform-plugin-mux to migrate from terraform-plugin-sdk to this framework, they can now omit the usage of the `tf6to5server` package by setting the `ServeOpts` type `ProtocolVersion` field to `5`. Any protocol layer restrictions with the older protocol version 5 are raised as errors from the framework. For example, if `Attributes` is defined in a `tfsdk.Attribute` ("nested attributes"), the `GetProviderSchema` RPC response will include an error diagnostic. This implementation is essentially a duplication of the `internal/fromproto6`, `internal/proto6server`, and `internal/toproto6` packages with renaming of 6 to 5 and any minor RPC naming differences to match the protocol (e.g. `ValidateDataResourceConfig` -> `ValidateDataSourceConfig`, `ValidateProviderConfig` -> `PrepareProviderConfig`, `ValidateResourceConfig` -> `ValidateResourceTypeConfig`).
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.
I'm going to be completely honest, I only skimmed this owing to the size of the PR but it LGTM.
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.
Aside from a potential typo in a comment, this looks good.
But I admit, is too large to review everything: I take the description as guideline that this does what's supposed to do :)
Co-authored-by: Ivan De Marino <ivan.demarino@hashicorp.com>
…ementations Reference: hashicorp/terraform-plugin-framework#368 terraform-plugin-framework v0.9.0 will natively support Terraform Plugin Protocol version 5, which simplifies implementations which must support Terraform CLI 0.12 or later, or those migrating from terraform-plugin-sdk/v2 to the framework and using terraform-plugin-mux. Other plugin documentation is being separately updated.
…ementations (#42) Reference: hashicorp/terraform-plugin-framework#368 terraform-plugin-framework v0.9.0 will natively support Terraform Plugin Protocol version 5, which simplifies implementations which must support Terraform CLI 0.12 or later, or those migrating from terraform-plugin-sdk/v2 to the framework and using terraform-plugin-mux. Other plugin documentation is being separately updated.
… version 5 Reference: hashicorp/terraform-plugin-framework#368 Provider developers no longer need to use the terraform-plugin-mux `tf6to5server` package when combining sdk/v2 and framework providers with Terraform 0.12 and later compatibility.
… version 5 (#984) Reference: hashicorp/terraform-plugin-framework#368 Provider developers no longer need to use the terraform-plugin-mux `tf6to5server` package when combining sdk/v2 and framework providers with Terraform 0.12 and later compatibility.
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Reference: #158
This enables provider developers to natively create and serve framework providers on protocol version 5, which is compatible with Terraform CLI 0.12 and later. For provider developers that are using terraform-plugin-mux to migrate from terraform-plugin-sdk to this framework, they can now omit the usage of the
tf6to5server
package by setting theServeOpts
typeProtocolVersion
field to5
.Any protocol layer restrictions with the older protocol version 5 are raised as errors from the framework. For example, if
Attributes
is defined in atfsdk.Attribute
("nested attributes"), theGetProviderSchema
RPC response will include an error diagnostic.This implementation is essentially a duplication of the
internal/fromproto6
,internal/proto6server
, andinternal/toproto6
packages with renaming of 6 to 5 and any minor RPC naming differences to match the protocol (e.g.ValidateDataResourceConfig
->ValidateDataSourceConfig
,ValidateProviderConfig
->PrepareProviderConfig
,ValidateResourceConfig
->ValidateResourceTypeConfig
).