mirror of https://github.com/docker/compose.git
support deploy.replicas
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
be1c65d441
commit
6c57fb9693
|
@ -167,9 +167,13 @@ func (c client) Convert(project *compose.Project) (*cloudformation.Template, err
|
|||
serviceSecurityGroups = append(serviceSecurityGroups, cloudformation.Ref(logicalName))
|
||||
}
|
||||
|
||||
desiredCount := 1
|
||||
if service.Deploy != nil && service.Deploy.Replicas != nil {
|
||||
desiredCount = int(*service.Deploy.Replicas)
|
||||
}
|
||||
template.Resources[fmt.Sprintf("%sService", normalizeResourceName(service.Name))] = &ecs.Service{
|
||||
Cluster: cluster,
|
||||
DesiredCount: 1,
|
||||
DesiredCount: desiredCount,
|
||||
LaunchType: ecsapi.LaunchTypeFargate,
|
||||
NetworkConfiguration: &ecs.Service_NetworkConfiguration{
|
||||
AwsvpcConfiguration: &ecs.Service_AwsVpcConfiguration{
|
||||
|
|
|
@ -317,14 +317,10 @@ func getImage(image string) string {
|
|||
|
||||
func getRepoCredentials(service types.ServiceConfig) *ecs.TaskDefinition_RepositoryCredentials {
|
||||
// extract registry and namespace string from image name
|
||||
credential := ""
|
||||
for key, value := range service.Extras {
|
||||
if key == "x-aws-pull_credentials" {
|
||||
credential = value.(string)
|
||||
return &ecs.TaskDefinition_RepositoryCredentials{CredentialsParameter: value.(string)}
|
||||
}
|
||||
}
|
||||
if credential != "" {
|
||||
return &ecs.TaskDefinition_RepositoryCredentials{CredentialsParameter: credential}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue