Skip to content

Commit

Permalink
add packer user agent to HCP client (#11455)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylviamoss committed Dec 17, 2021
1 parent 63eaf1f commit ef41e75
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/registry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
rmmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/models"
"github.com/hashicorp/hcp-sdk-go/httpclient"
"github.com/hashicorp/packer/internal/registry/env"
"github.com/hashicorp/packer/version"
)

// Client is an HCP client capable of making requests on behalf of a service principal
Expand All @@ -35,7 +36,9 @@ func NewClient() (*Client, error) {
}
}

cl, err := httpclient.New(httpclient.Config{})
cl, err := httpclient.New(httpclient.Config{
SourceChannel: fmt.Sprintf("packer/%s", version.PackerVersion.FormattedVersion()),
})
if err != nil {
return nil, &ClientError{
StatusCode: InvalidClientConfig,
Expand Down

0 comments on commit ef41e75

Please sign in to comment.