diff --git a/aci/login/client.go b/aci/login/client.go index dbc1bd4fd..79c3baf7e 100644 --- a/aci/login/client.go +++ b/aci/login/client.go @@ -34,6 +34,9 @@ import ( "github.com/docker/compose-cli/pkg/api" ) +// UserAgentName is the default user agent used by the cli +const UserAgentName = "docker-cli" + // NewContainerGroupsClient get client toi manipulate containerGrouos func NewContainerGroupsClient(subscriptionID string) (containerinstance.ContainerGroupsClient, error) { authorizer, mgmtURL, err := getClientSetupData() @@ -52,7 +55,7 @@ func NewContainerGroupsClient(subscriptionID string) (containerinstance.Containe } func setupClient(aciClient *autorest.Client, auth autorest.Authorizer) { - aciClient.UserAgent = internal.UserAgentName + "/" + internal.Version + aciClient.UserAgent = UserAgentName + "/" + internal.Version aciClient.Authorizer = auth } diff --git a/ecs/sdk.go b/ecs/sdk.go index 3205718ed..c0fbb7375 100644 --- a/ecs/sdk.go +++ b/ecs/sdk.go @@ -79,9 +79,12 @@ type sdk struct { // sdk implement API var _ API = sdk{} +// UserAgentName is the ECS specific user agent used by the cli +const UserAgentName = "Docker CLI" + func newSDK(sess *session.Session) sdk { sess.Handlers.Build.PushBack(func(r *request.Request) { - request.AddToUserAgent(r, internal.ECSUserAgentName+"/"+internal.Version) + request.AddToUserAgent(r, UserAgentName+"/"+internal.Version) }) return sdk{ ECS: ecs.New(sess), diff --git a/internal/variables.go b/internal/variables.go index ddb705412..a1144843a 100644 --- a/internal/variables.go +++ b/internal/variables.go @@ -16,13 +16,6 @@ package internal -const ( - // UserAgentName is the default user agent used by the cli - UserAgentName = "docker-cli" - // ECSUserAgentName is the ECS specific user agent used by the cli - ECSUserAgentName = "Docker CLI" -) - var ( // Version is the version of the CLI injected in compilation time Version = "dev"