-
Notifications
You must be signed in to change notification settings - Fork 212
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 Provider.UserAgent to generate the user agent header #552
base: master
Are you sure you want to change the base?
use Provider.UserAgent to generate the user agent header #552
Conversation
79b9fea
to
ea2afe1
Compare
also updating goreleaser configuration to capture version and commit in a way that is easily accessible by the provider configure code
ea2afe1
to
53dbfa4
Compare
@@ -97,13 +101,26 @@ func Provider() *schema.Provider { | |||
} | |||
|
|||
p.ConfigureFunc = func(d *schema.ResourceData) (interface{}, error) { | |||
terraformVersion := p.TerraformVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the only thing that was happening in ConfigureFunc
was normalizing the Terraform version. That should not be necessary when using Provider.UserAgent
so I just moved the body of providerConfigure
here. I didn't see a reason to have a separate function.
@@ -5,7 +5,7 @@ builds: | |||
flags: | |||
- -trimpath | |||
ldflags: | |||
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' | |||
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X github.com/terraform-providers/terraform-provider-pagerduty/pagerduty.version={{.Version}} -X github.com/terraform-providers/terraform-provider-pagerduty/pagerduty.commit={{.Commit}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
main.version
and main.commit
could be removed here -- those variables don't exist so the current (before this change) configuration is kind of a no-op.
also updating goreleaser configuration to capture version and commit in a way that is easily accessible by the provider configure code
Depends upon heimweh/go-pagerduty#97 (and updating the vendor copy here), so setting this to draft until that is merged.