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

tf6to5server: Consider Automatically Handling UpgradeResourceState Legacy Features #55

Closed
bflad opened this issue Feb 15, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@bflad
Copy link
Contributor

bflad commented Feb 15, 2022

terraform-plugin-mux version

v0.5.0

Use cases

While terraform-provider-framework has not actually implemented UpgradeResourceState handling (refer to hashicorp/terraform-plugin-framework#42), there is currently a passthrough implementation there since the RPC is always invoked. When passing a framework provider through terraform-plugin-mux tf6to5server for Terraform CLI 0.12+ compatibility, there should be no errors either.

However, Terraform CLI 0.12 through 0.14 return the following (less than helpful) error:

Error: EOF

This is because those versions of Terraform CLI requires the Msgpack field to be populated. This would require converting from Response JSON (if provided) to MessagePack (if not provided). There may be possibility to also perform some legacy handling with the requests as well (e.g. converting flatmap to JSON), otherwise each wrapped server would also need to handle that data.

Attempted solutions

Considering a terraform-plugin-framework specific implementation, which wouldn't necessarily help the larger ecosystem when using this package with other tf6server implementations.

Proposal

In the tf6to5server implementation for UpgradeResourceState, check if UpgradedState only includes the JSON field. If so, convert it to MessagePack and send in the Msgpack field.

References

@bflad bflad added the enhancement New feature or request label Feb 15, 2022
@bflad
Copy link
Contributor Author

bflad commented Feb 16, 2022

Thinking about this more, we should keep these Go packages as simple as possible and this functionality should be considered out of scope. Having this automatically handled may not be obvious that it exists here and it would be awkward to redirect folks to depending on this.

@bflad bflad closed this as completed Feb 16, 2022
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant