From e63a03f7547eb7b7c0e7c51713ca3e8fd8647135 Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Thu, 11 Jul 2024 15:52:24 +0000 Subject: [PATCH] allow customizing user agent for Azure cluster-autoscaler provider --- cluster-autoscaler/cloudprovider/azure/azure_util.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/azure/azure_util.go b/cluster-autoscaler/cloudprovider/azure/azure_util.go index 5a389b738c63..e6debcd8a6da 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_util.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_util.go @@ -25,6 +25,7 @@ import ( "io/ioutil" "net/http" "net/url" + "os" "regexp" "sort" "strconv" @@ -244,7 +245,8 @@ func decodePkcs12(pkcs []byte, password string) (*x509.Certificate, *rsa.Private } func getUserAgentExtension() string { - return fmt.Sprintf("cluster-autoscaler/v%s", version.ClusterAutoscalerVersion) + suffix := os.Getenv("AZURE_CLUSTER_AUTOSCALER_USER_AGENT_SUFFIX") + return fmt.Sprintf("cluster-autoscaler%s/v%s", suffix, version.ClusterAutoscalerVersion) } func configureUserAgent(client *autorest.Client) {