mirror of https://github.com/docker/compose.git
fix test data
Signed-off-by: aiordache <anca.iordache@docker.com> Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
2ea694a1c5
commit
02cc644c5a
|
@ -89,7 +89,7 @@ func (c client) Convert(project *compose.Project) (*cloudformation.Template, err
|
|||
|
||||
// Private DNS namespace will allow DNS name for the services to be <service>.<project>.local
|
||||
c.createCloudMap(project, template)
|
||||
loadBalancer := c.createLoadBalancer(project, template)
|
||||
loadBalancer := c.createLoadBalancer(project, template, "network")
|
||||
|
||||
for _, service := range project.Services {
|
||||
definition, err := Convert(project, service)
|
||||
|
@ -177,20 +177,14 @@ func (c client) Convert(project *compose.Project) (*cloudformation.Template, err
|
|||
return template, nil
|
||||
}
|
||||
|
||||
func (c client) createLoadBalancer(project *compose.Project, template *cloudformation.Template) string {
|
||||
|
||||
loadBalancerType := "network"
|
||||
loadBalancerName := fmt.Sprintf(
|
||||
"%s%sLB",
|
||||
strings.Title(project.Name),
|
||||
strings.ToUpper(loadBalancerType[0:1]),
|
||||
)
|
||||
func (c client) createLoadBalancer(project *compose.Project, template *cloudformation.Template, loadBalancerType string) string {
|
||||
loadBalancerName := fmt.Sprintf("%sLoadBalancer", strings.Title(project.Name))
|
||||
// Create LoadBalancer if `ParameterLoadBalancerName` is not set
|
||||
template.Conditions["CreateLoadBalancer"] = cloudformation.Equals("", cloudformation.Ref(ParameterLoadBalancerARN))
|
||||
|
||||
loadBalancer := &elasticloadbalancingv2.LoadBalancer{
|
||||
template.Resources[loadBalancerName] = &elasticloadbalancingv2.LoadBalancer{
|
||||
Name: loadBalancerName,
|
||||
Scheme: "internet-facing",
|
||||
Scheme: elbv2.LoadBalancerSchemeEnumInternetFacing,
|
||||
Subnets: []string{
|
||||
cloudformation.Ref(ParameterSubnet1Id),
|
||||
cloudformation.Ref(ParameterSubnet2Id),
|
||||
|
@ -204,7 +198,6 @@ func (c client) createLoadBalancer(project *compose.Project, template *cloudform
|
|||
Type: loadBalancerType,
|
||||
AWSCloudFormationCondition: "CreateLoadBalancer",
|
||||
}
|
||||
template.Resources[loadBalancerName] = loadBalancer
|
||||
loadBalancerRef := cloudformation.If("CreateLoadBalancer", cloudformation.Ref(loadBalancerName), cloudformation.Ref(ParameterLoadBalancerARN))
|
||||
|
||||
return loadBalancerRef
|
||||
|
|
|
@ -258,10 +258,10 @@
|
|||
},
|
||||
"Type": "AWS::EC2::SecurityGroupIngress"
|
||||
},
|
||||
"TestSimpleConvertNLB": {
|
||||
"TestSimpleConvertLoadBalancer": {
|
||||
"Condition": "CreateLoadBalancer",
|
||||
"Properties": {
|
||||
"Name": "TestSimpleConvertNLB",
|
||||
"Name": "TestSimpleConvertLoadBalancer",
|
||||
"Scheme": "internet-facing",
|
||||
"Subnets": [
|
||||
{
|
||||
|
|
|
@ -258,10 +258,10 @@
|
|||
},
|
||||
"Type": "AWS::EC2::SecurityGroupIngress"
|
||||
},
|
||||
"TestSimpleWithOverridesNLB": {
|
||||
"TestSimpleWithOverridesLoadBalancer": {
|
||||
"Condition": "CreateLoadBalancer",
|
||||
"Properties": {
|
||||
"Name": "TestSimpleWithOverridesNLB",
|
||||
"Name": "TestSimpleWithOverridesLoadBalancer",
|
||||
"Scheme": "internet-facing",
|
||||
"Subnets": [
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue