vmware / terraform-provider-vcf

Terraform Provider for VMware Cloud Foundation
https://registry.terraform.io/providers/vmware/vcf/
Mozilla Public License 2.0
22 stars 9 forks source link

feat: integrate `terraform-plugin-mux` and reimplement `r/network_pool` using the plugin framework #192

Closed spacegospod closed 1 month ago

spacegospod commented 3 months ago

Summary of Pull Request

Overview

Terraform offers 2 versions of its SDK

  1. github.com/hashicorp/terraform-plugin-sdk/v2 (legacy)
  2. github.com/hashicorp/terraform-plugin-framework (latest)

The latter offers numerous benefits over its predecessor and while migrating to the latest SDK is not mandatory it is certainly beneficial.

Instead of migrating the entire provider in a single change I am utilizing the plugin mux which allows for 2 implementations of a provider, one for each protocol version, to coexist in the same binary. RPC calls for resources will automatically be routed to the implementation that hosts them which allows us to migrate the provider to the Plugin Framework one resource at a time.

List of changes

Dependencies

Added dependencies to github.com/hashicorp/terraform-plugin-framework, github.com/hashicorp/terraform-plugin-mux and their subsidiaries

Resources

This change only affects resource_network_pool. All other resources and data sources remain unchanged. The schema for resource_network_pool remains identical to the original and no breaking changes are expected.

Tests

No changes to the tests cases are necessary. The migrated resource is expected to be a carbon copy of the original in terms of functionality. The only modification I've made is to bootstrap the correct provider implementation for the affected tests.

Type of Pull Request

Related to Existing Issues

Issue Number: N/A

Test and Documentation Coverage

Ran TestAccResourceVcfNetworkPool to verify that the migrated resource is identical to the original Ran TestAccResourceVcfCeip to verify that non-migrated resources are not broken by the changes to the provider configuration Ran the provider binary separately to verify that the actual deliverable works as before

For bug fixes or features:

Breaking Changes?

tenthirtyam commented 3 months ago

Will review by end of week.

github-actions[bot] commented 1 week ago

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 issues.

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