upbound / provider-terraform

A @crossplane provider for Terraform
Apache License 2.0
124 stars 55 forks source link

Workspace are deleted and recreated on every iteration for remote repositories #275

Closed arththebird closed 6 days ago

arththebird commented 1 week ago

What happened?

The provider currently deletes and recreates the Workspace directory for remote repositories as detailed here. My understanding is that this was added as a workaround for an issue in the go-getter library where it would fail to pull a repository in an existing directory. This has the effect of requiring Terraform to download the providers every time when the plugin cache is disabled (required when using max-reconcile-rate > 0), increasing NAT cost and reducing performance as explained here.

The go-getter bug seems to be fixed in the latest v1 release (v1.7.5), so this code could probably be removed if we upgrade to the latest v1 release.

How can we reproduce it?

What environment did it happen in?

bobh66 commented 1 week ago

This is likely related to #230 - I would expect renovate to upgrade the go-getter dependency as soon as it can. Definitely would be nice to fix this.

arththebird commented 1 week ago

This is likely related to #230 - I would expect renovate to upgrade the go-getter dependency as soon as it can. Definitely would be nice to fix this.

I think the renovate PR is already up for review here

bobh66 commented 1 week ago

Oops - right - I have been trying to get the last CI job to run before I merge it and I didn't make the connection. I don't know why the job isn't being picked up by a runner, but I'll kick it one more time and if it doesn't run I'll just merge the change.