rancher / terraform-provider-rancher2

Terraform Rancher2 provider
https://www.terraform.io/docs/providers/rancher2/
Mozilla Public License 2.0
260 stars 223 forks source link

[RFE] Setup auto generation for utility code #1134

Open a-blender opened 1 year ago

a-blender commented 1 year ago

Is your feature request related to a problem? Please describe.

1. Terraform needs to be upgraded to use SDK v2 which will enable better debugging and diagnostics support, specifically the ability to run the TF binary with an IDE debugger (which we could not do before and is a pain point for dev. We've had to guess on multiple past fixes because we have no way to step through the code. Examples are the plan bug and kubeconfig token generation). Covered by existing https://github.com/rancher/terraform-provider-rancher2/issues/1080.

  1. There's also a lot of patterned code in the TFP provider and it'd save a lot of time to find a way to auto generate all the schemas, expanders, and flatteners.
a-blender commented 1 year ago

We just did this for the TF rke provider https://github.com/rancher/terraform-provider-rancher2/issues/1134 and now it needs to be implemented for rancher2.

felipe-colussi commented 1 year ago

@a-blender Before working on this we probably should consider checking the new terraform plugin framework.

Different of the upgrade from the SDKv1 -> SDKv2 the upgrade from SDKv2 -> Plugin-framework can be done in parts.

IMO if we do a code generator we probably should do it on the latest versions. For what I read on the framework now will be possible to "unmarshal" the tf config into a struct, which would make this task much easier.

felipe-colussi commented 1 year ago

This is not the right place to this, but I was doing some research on the Framework. I'll keep some notes here for tracking before we have a talk and decide things about doing (or not) this migration.

Notes from Migrating SDK-v2 to the new Framework.

Advantage:

a-blender commented 11 months ago

Blocked until work for migration to SDK v2 https://github.com/rancher/terraform-provider-rancher2/issues/1080 is merged.