Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the terraform-plugin-sdk user agent string with running tf version #311

Merged
merged 4 commits into from
Jun 5, 2020

Conversation

awilliamsOM1
Copy link
Contributor

Http requests now using the user-agent built by the terraform-plugin-sdk using the running terraform version string instead of the default Go user agent.

Before: Go-http-client/1.1
After: HashiCorp Terraform/0.12.25 (+https://www.terraform.io) Terraform Plugin SDK/1.6.0

Starting with Terraform version v.0.12 the running version Terraform can be obtained from the provider. However this field is not included in prior versions of Terraform and the running version cannot be discovered. As a way to support older versions, the version string of "0.11+compatible" is used. This was inspired by the way the aws provider plugin works, hashicorp/terraform-provider-aws@0e183c1

Fix for issue #276.

@awilliamsOM1 awilliamsOM1 changed the title #276 Use the terraform-plugin-sdk user agent string with running tf version Use the terraform-plugin-sdk user agent string with running tf version Jun 2, 2020
@mrparkers
Copy link
Owner

thanks for this, this is a good change. I made one small update to compute the user agent in the provider package, since I want to keep the keycloak package free of anything terraform related so it can be used outside of the context of this provider.

@awilliamsOM1
Copy link
Contributor Author

Thanks for making the change and fixing the tests. Moving the user agent building to prevent a terraform dependency in the keycloak package makes sense. Thanks!

@mrparkers mrparkers merged commit dab6af6 into mrparkers:master Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants