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

Update User Agent #511

Merged
merged 2 commits into from
May 11, 2020
Merged

Update User Agent #511

merged 2 commits into from
May 11, 2020

Conversation

gzussa
Copy link
Contributor

@gzussa gzussa commented May 11, 2020

No description provided.

@ghost ghost added the size/XS label May 11, 2020
@@ -111,7 +111,12 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {

c := cleanhttp.DefaultClient()
c.Transport = logging.NewTransport("Datadog", c.Transport)
communityClient.ExtraHeader["User-Agent"] = fmt.Sprintf("terraform-provider-datadog/%s (go %s; terraform %s; terraform-cli %s)", version.ProviderVersion, runtime.Version(), meta.SDKVersionString(), datadogProvider.TerraformVersion)
communityClient.ExtraHeader["User-Agent"] = fmt.Sprintf(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use getUserAgent and just pass "" as the last argument?

Copy link
Contributor

@nmuesch nmuesch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran a quick test on TF 0.11.10 and 0.12.18 on the User resource (which uses the old client) And looks like it comes in as expected 💯

return fmt.Sprintf("terraform-provider-datadog/%s (terraform %s) %s", version.ProviderVersion, meta.SDKVersionString(), clientUserAgent)
return fmt.Sprintf("terraform-provider-datadog/%s (go %s; terraform %s; terraform-cli %s) %s",
version.ProviderVersion,
runtime.Version(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one may appear twice (as I believe its defined inside the datadogV1 user agent header, but I don't think it'll be an issue

@gzussa gzussa merged commit d4564b1 into master May 11, 2020
@gzussa gzussa deleted the gzu/ua branch May 11, 2020 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants