mirror of
https://github.com/docker/compose.git
synced 2025-07-24 22:24:41 +02:00
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,
|
Cpu: cpu,
|
||||||
Family: project.Name,
|
Family: fmt.Sprintf("%s-%s", project.Name, service.Name),
|
||||||
IpcMode: service.Ipc,
|
IpcMode: service.Ipc,
|
||||||
Memory: mem,
|
Memory: mem,
|
||||||
NetworkMode: ecsapi.NetworkModeAwsvpc, // FIXME could be set by service.NetworkMode, Fargate only supports network mode ‘awsvpc’.
|
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")
|
fmt.Fprintf(w, "Name\tState\tPorts\n")
|
||||||
defer w.Flush()
|
defer w.Flush()
|
||||||
|
|
||||||
arns, err := c.api.ListTasks(ctx, cluster, project.Name)
|
arns := []string{}
|
||||||
if err != nil {
|
for _, service := range project.Services {
|
||||||
return err
|
tasks, err := c.api.ListTasks(ctx, cluster, service.Name)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
arns = append(arns, tasks...)
|
||||||
}
|
}
|
||||||
if len(arns) == 0 {
|
if len(arns) == 0 {
|
||||||
return nil
|
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{
|
tasks, err := s.ECS.ListTasksWithContext(ctx, &ecs.ListTasksInput{
|
||||||
Cluster: aws.String(cluster),
|
Cluster: aws.String(cluster),
|
||||||
Family: aws.String(name),
|
ServiceName: aws.String(service),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -181,7 +181,7 @@
|
|||||||
"ExecutionRoleArn": {
|
"ExecutionRoleArn": {
|
||||||
"Ref": "SimpleTaskExecutionRole"
|
"Ref": "SimpleTaskExecutionRole"
|
||||||
},
|
},
|
||||||
"Family": "TestSimpleConvert",
|
"Family": "TestSimpleConvert-simple",
|
||||||
"Memory": "512",
|
"Memory": "512",
|
||||||
"NetworkMode": "awsvpc",
|
"NetworkMode": "awsvpc",
|
||||||
"RequiresCompatibilities": [
|
"RequiresCompatibilities": [
|
||||||
|
@ -181,7 +181,7 @@
|
|||||||
"ExecutionRoleArn": {
|
"ExecutionRoleArn": {
|
||||||
"Ref": "SimpleTaskExecutionRole"
|
"Ref": "SimpleTaskExecutionRole"
|
||||||
},
|
},
|
||||||
"Family": "TestSimpleWithOverrides",
|
"Family": "TestSimpleWithOverrides-simple",
|
||||||
"Memory": "512",
|
"Memory": "512",
|
||||||
"NetworkMode": "awsvpc",
|
"NetworkMode": "awsvpc",
|
||||||
"RequiresCompatibilities": [
|
"RequiresCompatibilities": [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user