Skip to content

Commit

Permalink
Configure User-Agent for OnCallClient (#790)
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantinov-Innokentii committed Jan 20, 2023
1 parent 8ea234a commit e8c61d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/Masterminds/semver/v3 v3.2.0
github.com/grafana/amixr-api-go-client v0.0.5
github.com/grafana/amixr-api-go-client v0.0.6
github.com/grafana/grafana-api-golang-client v0.18.2
github.com/grafana/machine-learning-go-client v0.3.0
github.com/grafana/synthetic-monitoring-agent v0.14.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grafana/amixr-api-go-client v0.0.5 h1:jqmljnd5FozuOsCNuyhZVpooxmj0BW9MmeLA7PaLK6U=
github.com/grafana/amixr-api-go-client v0.0.5/go.mod h1:N6x26XUrM5zGtK5zL5vNJnAn2JFMxLFPPLTw/6pDkFE=
github.com/grafana/amixr-api-go-client v0.0.6 h1:dDKSROgxg2NUuNBeF3L/0cfD9nG815OjSn0C8KtlUYI=
github.com/grafana/amixr-api-go-client v0.0.6/go.mod h1:N6x26XUrM5zGtK5zL5vNJnAn2JFMxLFPPLTw/6pDkFE=
github.com/grafana/grafana-api-golang-client v0.18.2 h1:WPYT4Cyw0uqBHAyO619HykzNsQ98yHKFmPuJonfiW8c=
github.com/grafana/grafana-api-golang-client v0.18.2/go.mod h1:24W29gPe9yl0/3A9X624TPkAOR8DpHno490cPwnkv8E=
github.com/grafana/machine-learning-go-client v0.3.0 h1:QmDPt9kFvw7RsVZE92V4tSbng2dHsOsVsHvNczLpNy8=
Expand Down
5 changes: 4 additions & 1 deletion grafana/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,13 @@ func configure(version string, p *schema.Provider) func(context.Context, *schema
c.smapi = smapi.NewClient(c.smURL, smToken, nil)
}
if d.Get("oncall_access_token").(string) != "" {
c.onCallAPI, err = createOnCallClient(d)
var onCallClient *onCallAPI.Client
onCallClient, err = createOnCallClient(d)
if err != nil {
return nil, diag.FromErr(err)
}
onCallClient.UserAgent = p.UserAgent("terraform-provider-grafana", version)
c.onCallAPI = onCallClient
}

storeDashboardSHA256 = d.Get("store_dashboard_sha256").(bool)
Expand Down

0 comments on commit e8c61d1

Please sign in to comment.