mirror of
https://github.com/docker/compose.git
synced 2025-07-24 22:24:41 +02:00
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
|
// Private DNS namespace will allow DNS name for the services to be <service>.<project>.local
|
||||||
c.createCloudMap(project, template)
|
c.createCloudMap(project, template)
|
||||||
loadBalancer := c.createLoadBalancer(project, template)
|
loadBalancer := c.createLoadBalancer(project, template, "network")
|
||||||
|
|
||||||
for _, service := range project.Services {
|
for _, service := range project.Services {
|
||||||
definition, err := Convert(project, service)
|
definition, err := Convert(project, service)
|
||||||
@ -177,20 +177,14 @@ func (c client) Convert(project *compose.Project) (*cloudformation.Template, err
|
|||||||
return template, nil
|
return template, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c client) createLoadBalancer(project *compose.Project, template *cloudformation.Template) string {
|
func (c client) createLoadBalancer(project *compose.Project, template *cloudformation.Template, loadBalancerType string) string {
|
||||||
|
loadBalancerName := fmt.Sprintf("%sLoadBalancer", strings.Title(project.Name))
|
||||||
loadBalancerType := "network"
|
|
||||||
loadBalancerName := fmt.Sprintf(
|
|
||||||
"%s%sLB",
|
|
||||||
strings.Title(project.Name),
|
|
||||||
strings.ToUpper(loadBalancerType[0:1]),
|
|
||||||
)
|
|
||||||
// Create LoadBalancer if `ParameterLoadBalancerName` is not set
|
// Create LoadBalancer if `ParameterLoadBalancerName` is not set
|
||||||
template.Conditions["CreateLoadBalancer"] = cloudformation.Equals("", cloudformation.Ref(ParameterLoadBalancerARN))
|
template.Conditions["CreateLoadBalancer"] = cloudformation.Equals("", cloudformation.Ref(ParameterLoadBalancerARN))
|
||||||
|
|
||||||
loadBalancer := &elasticloadbalancingv2.LoadBalancer{
|
template.Resources[loadBalancerName] = &elasticloadbalancingv2.LoadBalancer{
|
||||||
Name: loadBalancerName,
|
Name: loadBalancerName,
|
||||||
Scheme: "internet-facing",
|
Scheme: elbv2.LoadBalancerSchemeEnumInternetFacing,
|
||||||
Subnets: []string{
|
Subnets: []string{
|
||||||
cloudformation.Ref(ParameterSubnet1Id),
|
cloudformation.Ref(ParameterSubnet1Id),
|
||||||
cloudformation.Ref(ParameterSubnet2Id),
|
cloudformation.Ref(ParameterSubnet2Id),
|
||||||
@ -204,7 +198,6 @@ func (c client) createLoadBalancer(project *compose.Project, template *cloudform
|
|||||||
Type: loadBalancerType,
|
Type: loadBalancerType,
|
||||||
AWSCloudFormationCondition: "CreateLoadBalancer",
|
AWSCloudFormationCondition: "CreateLoadBalancer",
|
||||||
}
|
}
|
||||||
template.Resources[loadBalancerName] = loadBalancer
|
|
||||||
loadBalancerRef := cloudformation.If("CreateLoadBalancer", cloudformation.Ref(loadBalancerName), cloudformation.Ref(ParameterLoadBalancerARN))
|
loadBalancerRef := cloudformation.If("CreateLoadBalancer", cloudformation.Ref(loadBalancerName), cloudformation.Ref(ParameterLoadBalancerARN))
|
||||||
|
|
||||||
return loadBalancerRef
|
return loadBalancerRef
|
||||||
|
@ -258,10 +258,10 @@
|
|||||||
},
|
},
|
||||||
"Type": "AWS::EC2::SecurityGroupIngress"
|
"Type": "AWS::EC2::SecurityGroupIngress"
|
||||||
},
|
},
|
||||||
"TestSimpleConvertNLB": {
|
"TestSimpleConvertLoadBalancer": {
|
||||||
"Condition": "CreateLoadBalancer",
|
"Condition": "CreateLoadBalancer",
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"Name": "TestSimpleConvertNLB",
|
"Name": "TestSimpleConvertLoadBalancer",
|
||||||
"Scheme": "internet-facing",
|
"Scheme": "internet-facing",
|
||||||
"Subnets": [
|
"Subnets": [
|
||||||
{
|
{
|
||||||
|
@ -258,10 +258,10 @@
|
|||||||
},
|
},
|
||||||
"Type": "AWS::EC2::SecurityGroupIngress"
|
"Type": "AWS::EC2::SecurityGroupIngress"
|
||||||
},
|
},
|
||||||
"TestSimpleWithOverridesNLB": {
|
"TestSimpleWithOverridesLoadBalancer": {
|
||||||
"Condition": "CreateLoadBalancer",
|
"Condition": "CreateLoadBalancer",
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"Name": "TestSimpleWithOverridesNLB",
|
"Name": "TestSimpleWithOverridesLoadBalancer",
|
||||||
"Scheme": "internet-facing",
|
"Scheme": "internet-facing",
|
||||||
"Subnets": [
|
"Subnets": [
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user