Skip to content

Commit

Permalink
Merge pull request #5873 from tzneal/make-user-agent-more-informative
Browse files Browse the repository at this point in the history
add cluster-autoscaler name and version to the user agent
  • Loading branch information
k8s-ci-robot authored Jun 20, 2023
2 parents 7bc37f7 + 4e964b7 commit b91b127
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cluster-autoscaler/cloudprovider/aws/aws_sdk_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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,
}
Expand Down

0 comments on commit b91b127

Please sign in to comment.