mirror of https://github.com/docker/compose.git
move ACI/ECS -specific const to related packages
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
fcb91096b8
commit
88ba4599b2
|
@ -34,6 +34,9 @@ import (
|
||||||
"github.com/docker/compose-cli/pkg/api"
|
"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
|
// NewContainerGroupsClient get client toi manipulate containerGrouos
|
||||||
func NewContainerGroupsClient(subscriptionID string) (containerinstance.ContainerGroupsClient, error) {
|
func NewContainerGroupsClient(subscriptionID string) (containerinstance.ContainerGroupsClient, error) {
|
||||||
authorizer, mgmtURL, err := getClientSetupData()
|
authorizer, mgmtURL, err := getClientSetupData()
|
||||||
|
@ -52,7 +55,7 @@ func NewContainerGroupsClient(subscriptionID string) (containerinstance.Containe
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupClient(aciClient *autorest.Client, auth autorest.Authorizer) {
|
func setupClient(aciClient *autorest.Client, auth autorest.Authorizer) {
|
||||||
aciClient.UserAgent = internal.UserAgentName + "/" + internal.Version
|
aciClient.UserAgent = UserAgentName + "/" + internal.Version
|
||||||
aciClient.Authorizer = auth
|
aciClient.Authorizer = auth
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,9 +79,12 @@ type sdk struct {
|
||||||
// sdk implement API
|
// sdk implement API
|
||||||
var _ API = sdk{}
|
var _ API = sdk{}
|
||||||
|
|
||||||
|
// UserAgentName is the ECS specific user agent used by the cli
|
||||||
|
const UserAgentName = "Docker CLI"
|
||||||
|
|
||||||
func newSDK(sess *session.Session) sdk {
|
func newSDK(sess *session.Session) sdk {
|
||||||
sess.Handlers.Build.PushBack(func(r *request.Request) {
|
sess.Handlers.Build.PushBack(func(r *request.Request) {
|
||||||
request.AddToUserAgent(r, internal.ECSUserAgentName+"/"+internal.Version)
|
request.AddToUserAgent(r, UserAgentName+"/"+internal.Version)
|
||||||
})
|
})
|
||||||
return sdk{
|
return sdk{
|
||||||
ECS: ecs.New(sess),
|
ECS: ecs.New(sess),
|
||||||
|
|
|
@ -16,13 +16,6 @@
|
||||||
|
|
||||||
package internal
|
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 (
|
var (
|
||||||
// Version is the version of the CLI injected in compilation time
|
// Version is the version of the CLI injected in compilation time
|
||||||
Version = "dev"
|
Version = "dev"
|
||||||
|
|
Loading…
Reference in New Issue