1
0
Эх сурвалжийг харах

update test data

Signed-off-by: aiordache <[email protected]>
Signed-off-by: Nicolas De Loof <[email protected]>
aiordache 5 жил өмнө
parent
commit
2ea694a1c5

+ 26 - 1
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
+}

+ 13 - 0
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",

+ 13 - 0
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",