linode / terraform-provider-linode

Terraform Linode provider
https://www.terraform.io/docs/providers/linode/
Mozilla Public License 2.0
191 stars 92 forks source link

Reuse the client if it is already configured in fwprovider #1467

Closed tchinmai7 closed 3 weeks ago

tchinmai7 commented 1 month ago

📝 Description

What does this PR do and why is this change necessary? Crossplane provider-linode expects to use a single configured instance of the linode client across all invocations. However, due to how upjet operates, the configureProvider() gets invoked on every resource call. To preserve the client, see if the fp.Meta.Client is already initialized, and if so, re-use it.

✔️ How to Test

What are the steps to reproduce the issue or verify the changes?

How do I run the relevant unit/integration tests? The main thing here should be verifying it doesn't break any usual terraform flows.

📷 Preview

If applicable, include a screenshot or code snippet of this change. Otherwise, please remove this section.