Use a custom user-agent so AWS can track usage

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2020-09-10 16:50:23 +02:00
parent eaabee12e8
commit d649a5d92c
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
1 changed files with 6 additions and 3 deletions

View File

@ -22,12 +22,12 @@ import (
"strings"
"time"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/docker/compose-cli/api/compose"
"github.com/docker/compose-cli/api/secrets"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudformation"
"github.com/aws/aws-sdk-go/service/cloudformation/cloudformationiface"
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
@ -56,7 +56,10 @@ type sdk struct {
SM secretsmanageriface.SecretsManagerAPI
}
func newSDK(sess client.ConfigProvider) sdk {
func newSDK(sess *session.Session) sdk {
sess.Handlers.Build.PushBack(func(r *request.Request) {
request.AddToUserAgent(r, "Docker CLI")
})
return sdk{
ECS: ecs.New(sess),
EC2: ec2.New(sess),