tailscale / terraform-provider-tailscale

Terraform provider for Tailscale
https://registry.terraform.io/providers/tailscale/tailscale
MIT License
258 stars 47 forks source link

tailscale: fix default User-Agent header to include terraform version #361

Closed mpminardi closed 5 months ago

mpminardi commented 5 months ago

The schema.Provider.UserAgent helper function was previously being called at a point in the plugin lifecycle before the TerraformVersion for the provider was set by Terraform Core. This was resulting in the Terraform version information being missing from the User-Agent header. The call to schema.Provider.UserAgent has now been moved into the providerConfigure func as this is called later in the configure lifecycle where the Terraform version is properly set.

Header Before

Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.33.0 terraform-provider-tailscale/dev

Header After

Terraform/1.8.2 (+https://www.terraform.io) Terraform-Plugin-SDK/2.33.0 terraform-provider-tailscale/dev

Fixes https://github.com/tailscale/corp/issues/19630