mirror of https://github.com/docker/compose.git
Use distinct family per service definition
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
7d4222a725
commit
1bf4bc9d46
|
@ -77,7 +77,7 @@ func Convert(project *compose.Project, service types.ServiceConfig) (*ecs.TaskDe
|
|||
},
|
||||
},
|
||||
Cpu: cpu,
|
||||
Family: project.Name,
|
||||
Family: fmt.Sprintf("%s-%s", project.Name, service.Name),
|
||||
IpcMode: service.Ipc,
|
||||
Memory: mem,
|
||||
NetworkMode: ecsapi.NetworkModeAwsvpc, // FIXME could be set by service.NetworkMode, Fargate only supports network mode ‘awsvpc’.
|
||||
|
|
|
@ -20,9 +20,13 @@ func (c *client) ComposePs(ctx context.Context, project *compose.Project) error
|
|||
fmt.Fprintf(w, "Name\tState\tPorts\n")
|
||||
defer w.Flush()
|
||||
|
||||
arns, err := c.api.ListTasks(ctx, cluster, project.Name)
|
||||
if err != nil {
|
||||
return err
|
||||
arns := []string{}
|
||||
for _, service := range project.Services {
|
||||
tasks, err := c.api.ListTasks(ctx, cluster, service.Name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
arns = append(arns, tasks...)
|
||||
}
|
||||
if len(arns) == 0 {
|
||||
return nil
|
||||
|
|
|
@ -341,10 +341,10 @@ func (s sdk) GetLogs(ctx context.Context, name string, consumer LogConsumer) err
|
|||
}
|
||||
}
|
||||
|
||||
func (s sdk) ListTasks(ctx context.Context, cluster string, name string) ([]string, error) {
|
||||
func (s sdk) ListTasks(ctx context.Context, cluster string, service string) ([]string, error) {
|
||||
tasks, err := s.ECS.ListTasksWithContext(ctx, &ecs.ListTasksInput{
|
||||
Cluster: aws.String(cluster),
|
||||
Family: aws.String(name),
|
||||
Cluster: aws.String(cluster),
|
||||
ServiceName: aws.String(service),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
"ExecutionRoleArn": {
|
||||
"Ref": "SimpleTaskExecutionRole"
|
||||
},
|
||||
"Family": "TestSimpleConvert",
|
||||
"Family": "TestSimpleConvert-simple",
|
||||
"Memory": "512",
|
||||
"NetworkMode": "awsvpc",
|
||||
"RequiresCompatibilities": [
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
"ExecutionRoleArn": {
|
||||
"Ref": "SimpleTaskExecutionRole"
|
||||
},
|
||||
"Family": "TestSimpleWithOverrides",
|
||||
"Family": "TestSimpleWithOverrides-simple",
|
||||
"Memory": "512",
|
||||
"NetworkMode": "awsvpc",
|
||||
"RequiresCompatibilities": [
|
||||
|
|
Loading…
Reference in New Issue