Skip to content

Commit

Permalink
fix: cloud provider should only generate userAgent if it's not provid…
Browse files Browse the repository at this point in the history
…ed (#7723)

fix

revert
  • Loading branch information
andyzhangx authored Dec 3, 2024
1 parent b54a1c9 commit 88ef46c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/provider/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,11 @@ func (az *Cloud) InitializeCloudFromConfig(ctx context.Context, config *config.C
az.configAzureClients(servicePrincipalToken, multiTenantServicePrincipalToken, networkResourceServicePrincipalToken)

if az.ComputeClientFactory == nil {
k8sVersion := version.Get().GitVersion
az.ARMClientConfig.UserAgent = fmt.Sprintf("kubernetes-cloudprovider/%s; %s", k8sVersion, az.ARMClientConfig.UserAgent)
if az.ARMClientConfig.UserAgent == "" {
k8sVersion := version.Get().GitVersion
az.ARMClientConfig.UserAgent = fmt.Sprintf("kubernetes-cloudprovider/%s", k8sVersion)
}

var cred azcore.TokenCredential
if authProvider.IsMultiTenantModeEnabled() {
multiTenantCred := authProvider.GetMultiTenantIdentity()
Expand Down

0 comments on commit 88ef46c

Please sign in to comment.