mirror of https://github.com/docker/compose.git
Set aci user agent for MS metrics
This commit is contained in:
parent
3566c720e3
commit
425f9acb88
|
@ -21,6 +21,9 @@ import (
|
||||||
"github.com/docker/api/context/store"
|
"github.com/docker/api/context/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
const aciDockerUserAgent = "docker-cli"
|
||||||
|
|
||||||
func createACIContainers(ctx context.Context, aciContext store.AciContext, groupDefinition containerinstance.ContainerGroup) error {
|
func createACIContainers(ctx context.Context, aciContext store.AciContext, groupDefinition containerinstance.ContainerGroup) error {
|
||||||
containerGroupsClient, err := getContainerGroupsClient(aciContext.SubscriptionID)
|
containerGroupsClient, err := getContainerGroupsClient(aciContext.SubscriptionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -238,6 +241,7 @@ func getContainerGroupsClient(subscriptionID string) (containerinstance.Containe
|
||||||
}
|
}
|
||||||
containerGroupsClient := containerinstance.NewContainerGroupsClient(subscriptionID)
|
containerGroupsClient := containerinstance.NewContainerGroupsClient(subscriptionID)
|
||||||
containerGroupsClient.Authorizer = auth
|
containerGroupsClient.Authorizer = auth
|
||||||
|
containerGroupsClient.UserAgent= aciDockerUserAgent
|
||||||
containerGroupsClient.PollingDelay = 5 * time.Second
|
containerGroupsClient.PollingDelay = 5 * time.Second
|
||||||
containerGroupsClient.RetryAttempts = 30
|
containerGroupsClient.RetryAttempts = 30
|
||||||
containerGroupsClient.RetryDuration = 1 * time.Second
|
containerGroupsClient.RetryDuration = 1 * time.Second
|
||||||
|
@ -250,6 +254,7 @@ func getContainerClient(subscriptionID string) (containerinstance.ContainerClien
|
||||||
return containerinstance.ContainerClient{}, err
|
return containerinstance.ContainerClient{}, err
|
||||||
}
|
}
|
||||||
containerClient := containerinstance.NewContainerClient(subscriptionID)
|
containerClient := containerinstance.NewContainerClient(subscriptionID)
|
||||||
|
containerClient.UserAgent=aciDockerUserAgent
|
||||||
containerClient.Authorizer = auth
|
containerClient.Authorizer = auth
|
||||||
return containerClient, nil
|
return containerClient, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,6 +94,7 @@ func getSubscriptionsClient() (subscription.SubscriptionsClient, error) {
|
||||||
return subscription.SubscriptionsClient{}, errors.Wrap(errdefs.ErrLoginFailed, err.Error())
|
return subscription.SubscriptionsClient{}, errors.Wrap(errdefs.ErrLoginFailed, err.Error())
|
||||||
}
|
}
|
||||||
subc.Authorizer = authorizer
|
subc.Authorizer = authorizer
|
||||||
|
subc.UserAgent=aciDockerUserAgent
|
||||||
return subc, nil
|
return subc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,5 +102,6 @@ func getGroupsClient(subscriptionID string) resources.GroupsClient {
|
||||||
groupsClient := resources.NewGroupsClient(subscriptionID)
|
groupsClient := resources.NewGroupsClient(subscriptionID)
|
||||||
authorizer, _ := login.NewAuthorizerFromLogin()
|
authorizer, _ := login.NewAuthorizerFromLogin()
|
||||||
groupsClient.Authorizer = authorizer
|
groupsClient.Authorizer = authorizer
|
||||||
|
groupsClient.UserAgent=aciDockerUserAgent
|
||||||
return groupsClient
|
return groupsClient
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue