From 2ea694a1c5b7331e8c3820cae9ad9c876ca5e5a6 Mon Sep 17 00:00:00 2001 From: aiordache Date: Thu, 4 Jun 2020 17:09:41 +0200 Subject: [PATCH] update test data Signed-off-by: aiordache Signed-off-by: Nicolas De Loof --- ecs/pkg/amazon/api_mock.go | 27 ++++++++++++++++++- .../simple-cloudformation-conversion.golden | 13 +++++++++ ...formation-with-overrides-conversion.golden | 13 +++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/ecs/pkg/amazon/api_mock.go b/ecs/pkg/amazon/api_mock.go index 40e9f6872..cbf2b6d17 100644 --- a/ecs/pkg/amazon/api_mock.go +++ b/ecs/pkg/amazon/api_mock.go @@ -6,11 +6,12 @@ package amazon import ( context "context" + reflect "reflect" + cloudformation "github.com/aws/aws-sdk-go/service/cloudformation" cloudformation0 "github.com/awslabs/goformation/v4/cloudformation" docker "github.com/docker/ecs-plugin/pkg/docker" gomock "github.com/golang/mock/gomock" - reflect "reflect" ) // MockAPI is a mock of API interface @@ -324,3 +325,27 @@ func (mr *MockAPIMockRecorder) WaitStackComplete(arg0, arg1, arg2 interface{}) * mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitStackComplete", reflect.TypeOf((*MockAPI)(nil).WaitStackComplete), arg0, arg1, arg2) } + +// LoadBalancerExists mocks base method +func (m *MockAPI) LoadBalancerExists(arg0 context.Context, arg1 string) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LoadBalancerExists", arg0, arg1) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LoadBalancerExists indicates an expected call of VpcExists +func (mr *MockAPIMockRecorder) LoadBalancerExists(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadBalancerExists", reflect.TypeOf((*MockAPI)(nil).LoadBalancerExists), arg0, arg1) +} + +// GetLoadBalancerARN mocks base method +func (m *MockAPI) GetLoadBalancerARN(arg0 context.Context, arg1 string) (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetLoadBalancerARN", arg0) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} diff --git a/ecs/pkg/amazon/testdata/simple/simple-cloudformation-conversion.golden b/ecs/pkg/amazon/testdata/simple/simple-cloudformation-conversion.golden index 258fa960d..15006580c 100644 --- a/ecs/pkg/amazon/testdata/simple/simple-cloudformation-conversion.golden +++ b/ecs/pkg/amazon/testdata/simple/simple-cloudformation-conversion.golden @@ -8,6 +8,14 @@ "Ref": "ParameterClusterName" } ] + }, + "CreateLoadBalancer": { + "Fn::Equals": [ + "", + { + "Ref": "ParameterLoadBalancerARN" + } + ] } }, "Parameters": { @@ -15,6 +23,10 @@ "Description": "Name of the ECS cluster to deploy to (optional)", "Type": "String" }, + "ParameterLoadBalancerARN": { + "Description": "Name of the LoadBalancer to connect to (optional)", + "Type": "String" + }, "ParameterSubnet1Id": { "Description": "SubnetId, for Availability Zone 1 in the region in your VPC", "Type": "AWS::EC2::Subnet::Id" @@ -247,6 +259,7 @@ "Type": "AWS::EC2::SecurityGroupIngress" }, "TestSimpleConvertNLB": { + "Condition": "CreateLoadBalancer", "Properties": { "Name": "TestSimpleConvertNLB", "Scheme": "internet-facing", diff --git a/ecs/pkg/amazon/testdata/simple/simple-cloudformation-with-overrides-conversion.golden b/ecs/pkg/amazon/testdata/simple/simple-cloudformation-with-overrides-conversion.golden index 991f65b6b..0324c2892 100644 --- a/ecs/pkg/amazon/testdata/simple/simple-cloudformation-with-overrides-conversion.golden +++ b/ecs/pkg/amazon/testdata/simple/simple-cloudformation-with-overrides-conversion.golden @@ -8,6 +8,14 @@ "Ref": "ParameterClusterName" } ] + }, + "CreateLoadBalancer": { + "Fn::Equals": [ + "", + { + "Ref": "ParameterLoadBalancerARN" + } + ] } }, "Parameters": { @@ -15,6 +23,10 @@ "Description": "Name of the ECS cluster to deploy to (optional)", "Type": "String" }, + "ParameterLoadBalancerARN": { + "Description": "Name of the LoadBalancer to connect to (optional)", + "Type": "String" + }, "ParameterSubnet1Id": { "Description": "SubnetId, for Availability Zone 1 in the region in your VPC", "Type": "AWS::EC2::Subnet::Id" @@ -247,6 +259,7 @@ "Type": "AWS::EC2::SecurityGroupIngress" }, "TestSimpleWithOverridesNLB": { + "Condition": "CreateLoadBalancer", "Properties": { "Name": "TestSimpleWithOverridesNLB", "Scheme": "internet-facing",