diff --git a/cluster-autoscaler/cloudprovider/aws/aws_sdk_provider.go b/cluster-autoscaler/cloudprovider/aws/aws_sdk_provider.go index 1b1e64925c5f..b1f33442f71b 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_sdk_provider.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_sdk_provider.go @@ -27,7 +27,9 @@ import ( "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/ec2metadata" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/endpoints" + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/session" + "k8s.io/autoscaler/cluster-autoscaler/version" provider_aws "k8s.io/cloud-provider-aws/pkg/providers/v1" "k8s.io/klog/v2" ) @@ -61,11 +63,14 @@ func createAWSSDKProvider(configReader io.Reader) (*awsSDKProvider, error) { } sess, err := session.NewSession(config) - if err != nil { return nil, err } + // add cluster-autoscaler to the user-agent to make it easier to identify + agent := fmt.Sprintf("cluster-autoscaler/v%s", version.ClusterAutoscalerVersion) + sess.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler(agent)) + provider := &awsSDKProvider{ session: sess, }