support deploy.replicas

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2020-05-28 11:09:36 +02:00
parent be1c65d441
commit 6c57fb9693
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
2 changed files with 6 additions and 6 deletions

View File

@ -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{

View File

@ -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
}