mirror of https://github.com/docker/compose.git
Propagate service tags on Tasks
closes #188 Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
8582cb3928
commit
e7bc8081ba
|
@ -179,6 +179,7 @@ func (b Backend) Convert(project *types.Project) (*cloudformation.Template, erro
|
|||
},
|
||||
},
|
||||
},
|
||||
PropagateTags: ecsapi.PropagateTagsService,
|
||||
SchedulingStrategy: ecsapi.SchedulingStrategyReplica,
|
||||
ServiceRegistries: []ecs.Service_ServiceRegistry{serviceRegistry},
|
||||
Tags: []tags.Tag{
|
||||
|
|
|
@ -37,29 +37,13 @@ func Convert(project *types.Project, service types.ServiceConfig) (*ecs.TaskDefi
|
|||
fmt.Sprintf(" %s.local", project.Name),
|
||||
}))
|
||||
|
||||
tags := []tags.Tag{
|
||||
{
|
||||
Key: compose.ProjectTag,
|
||||
Value: project.Name,
|
||||
},
|
||||
{
|
||||
Key: compose.ServiceTag,
|
||||
Value: service.Name,
|
||||
},
|
||||
}
|
||||
tags = append(tags, toTags(service.Labels)...)
|
||||
|
||||
return &ecs.TaskDefinition{
|
||||
ContainerDefinitions: []ecs.TaskDefinition_ContainerDefinition{
|
||||
{
|
||||
Command: service.Command,
|
||||
DisableNetworking: service.NetworkMode == "none",
|
||||
DnsSearchDomains: service.DNSSearch,
|
||||
DnsServers: service.DNS,
|
||||
DockerLabels: map[string]string{
|
||||
compose.ProjectTag: project.Name,
|
||||
compose.ServiceTag: service.Name,
|
||||
},
|
||||
Command: service.Command,
|
||||
DisableNetworking: service.NetworkMode == "none",
|
||||
DnsSearchDomains: service.DNSSearch,
|
||||
DnsServers: service.DNS,
|
||||
DockerSecurityOptions: service.SecurityOpt,
|
||||
EntryPoint: service.Entrypoint,
|
||||
Environment: toKeyValuePair(service.Environment),
|
||||
|
@ -93,9 +77,8 @@ func Convert(project *types.Project, service types.ServiceConfig) (*ecs.TaskDefi
|
|||
SystemControls: toSystemControls(service.Sysctls),
|
||||
Ulimits: toUlimits(service.Ulimits),
|
||||
User: service.User,
|
||||
|
||||
VolumesFrom: nil,
|
||||
WorkingDirectory: service.WorkingDir,
|
||||
VolumesFrom: nil,
|
||||
WorkingDirectory: service.WorkingDir,
|
||||
},
|
||||
},
|
||||
Cpu: cpu,
|
||||
|
@ -107,7 +90,6 @@ func Convert(project *types.Project, service types.ServiceConfig) (*ecs.TaskDefi
|
|||
PlacementConstraints: toPlacementConstraints(service.Deploy),
|
||||
ProxyConfiguration: nil,
|
||||
RequiresCompatibilities: []string{ecsapi.LaunchTypeFargate},
|
||||
Tags: tags,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -116,6 +116,7 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"PropagateTags": "SERVICE",
|
||||
"SchedulingStrategy": "REPLICA",
|
||||
"ServiceRegistries": [
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue