From ac44f1d54a46df984aa2f74916cffe7f29895273 Mon Sep 17 00:00:00 2001 From: Kubernetes Prow Robot Date: Fri, 12 May 2023 00:50:46 -0700 Subject: [PATCH] Merge pull request #721 from lubronzhan/topic/lubron/set_useragent Use a meaningful user agent name --- pkg/common/vclib/connection.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/common/vclib/connection.go b/pkg/common/vclib/connection.go index 6938a69b5..a2a1c9230 100644 --- a/pkg/common/vclib/connection.go +++ b/pkg/common/vclib/connection.go @@ -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 @@ -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