Skip to content

Commit

Permalink
Merge pull request #721 from lubronzhan/topic/lubron/set_useragent
Browse files Browse the repository at this point in the history
Use a meaningful user agent name
  • Loading branch information
k8s-ci-robot authored and lubronzhan committed May 30, 2023
1 parent 7e703b9 commit ac44f1d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/common/vclib/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ import (
klog "k8s.io/klog/v2"
)

const (
userAgentName = "k8s-cloud-provider-vsphere"
)

// VSphereConnection contains information for connecting to vCenter
type VSphereConnection struct {
Client *vim25.Client
Expand Down Expand Up @@ -177,6 +181,7 @@ func (connection *VSphereConnection) NewClient(ctx context.Context) (*vim25.Clie
klog.Errorf("Failed to create new client. err: %+v", err)
return nil, err
}
client.UserAgent = userAgentName
err = connection.login(ctx, client)
if err != nil {
return nil, err
Expand Down

0 comments on commit ac44f1d

Please sign in to comment.