Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 88ba459

Browse files
committed
move ACI/ECS -specific const to related packages
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent fcb9109 commit 88ba459

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

aci/login/client.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ import (
3434
"github.com/docker/compose-cli/pkg/api"
3535
)
3636

37+
// UserAgentName is the default user agent used by the cli
38+
const UserAgentName = "docker-cli"
39+
3740
// NewContainerGroupsClient get client toi manipulate containerGrouos
3841
func NewContainerGroupsClient(subscriptionID string) (containerinstance.ContainerGroupsClient, error) {
3942
authorizer, mgmtURL, err := getClientSetupData()
@@ -52,7 +55,7 @@ func NewContainerGroupsClient(subscriptionID string) (containerinstance.Containe
5255
}
5356

5457
func setupClient(aciClient *autorest.Client, auth autorest.Authorizer) {
55-
aciClient.UserAgent = internal.UserAgentName + "/" + internal.Version
58+
aciClient.UserAgent = UserAgentName + "/" + internal.Version
5659
aciClient.Authorizer = auth
5760
}
5861

ecs/sdk.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,12 @@ type sdk struct {
7979
// sdk implement API
8080
var _ API = sdk{}
8181

82+
// UserAgentName is the ECS specific user agent used by the cli
83+
const UserAgentName = "Docker CLI"
84+
8285
func newSDK(sess *session.Session) sdk {
8386
sess.Handlers.Build.PushBack(func(r *request.Request) {
84-
request.AddToUserAgent(r, internal.ECSUserAgentName+"/"+internal.Version)
87+
request.AddToUserAgent(r, UserAgentName+"/"+internal.Version)
8588
})
8689
return sdk{
8790
ECS: ecs.New(sess),

internal/variables.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@
1616

1717
package internal
1818

19-
const (
20-
// UserAgentName is the default user agent used by the cli
21-
UserAgentName = "docker-cli"
22-
// ECSUserAgentName is the ECS specific user agent used by the cli
23-
ECSUserAgentName = "Docker CLI"
24-
)
25-
2619
var (
2720
// Version is the version of the CLI injected in compilation time
2821
Version = "dev"

0 commit comments

Comments
 (0)