@@ -70,34 +70,13 @@ func TestClusterScope_ReconcileInternetGateway(t *testing.T) {
7070 FreeformTags : tags ,
7171 DefinedTags : definedTagsInterface ,
7272 },
73- }, nil ). Times ( 2 )
73+ }, nil )
7474
7575 updatedTags := make (map [string ]string )
7676 for k , v := range tags {
7777 updatedTags [k ] = v
7878 }
7979 updatedTags ["foo" ] = "bar"
80- vcnClient .EXPECT ().UpdateInternetGateway (gomock .Any (), gomock .Eq (core.UpdateInternetGatewayRequest {
81- IgId : common .String ("foo" ),
82- UpdateInternetGatewayDetails : core.UpdateInternetGatewayDetails {
83- FreeformTags : updatedTags ,
84- DefinedTags : definedTagsInterface ,
85- },
86- })).
87- Return (core.UpdateInternetGatewayResponse {
88- InternetGateway : core.InternetGateway {
89- Id : common .String ("foo" ),
90- FreeformTags : tags ,
91- },
92- }, nil )
93- vcnClient .EXPECT ().UpdateInternetGateway (gomock .Any (), gomock .Eq (core.UpdateInternetGatewayRequest {
94- IgId : common .String ("igw_id" ),
95- UpdateInternetGatewayDetails : core.UpdateInternetGatewayDetails {
96- FreeformTags : updatedTags ,
97- DefinedTags : definedTagsInterface ,
98- },
99- })).
100- Return (core.UpdateInternetGatewayResponse {}, errors .New ("some error" ))
10180 vcnClient .EXPECT ().ListInternetGateways (gomock .Any (), gomock .Eq (core.ListInternetGatewaysRequest {
10281 CompartmentId : common .String ("foo" ),
10382 DisplayName : common .String ("internet-gateway" ),
@@ -190,22 +169,7 @@ func TestClusterScope_ReconcileInternetGateway(t *testing.T) {
190169 wantErr : false ,
191170 },
192171 {
193- name : "update needed" ,
194- spec : infrastructurev1beta1.OCIClusterSpec {
195- FreeformTags : map [string ]string {
196- "foo" : "bar" ,
197- },
198- DefinedTags : definedTags ,
199- NetworkSpec : infrastructurev1beta1.NetworkSpec {
200- Vcn : infrastructurev1beta1.VCN {
201- InternetGatewayId : common .String ("foo" ),
202- },
203- },
204- },
205- wantErr : false ,
206- },
207- {
208- name : "id not present in spec but found by name and update needed but error out" ,
172+ name : "id not present in spec but found by name and no update needed" ,
209173 spec : infrastructurev1beta1.OCIClusterSpec {
210174 CompartmentId : "foo" ,
211175 FreeformTags : map [string ]string {
@@ -218,8 +182,7 @@ func TestClusterScope_ReconcileInternetGateway(t *testing.T) {
218182 },
219183 },
220184 },
221- wantErr : true ,
222- expectedError : "failed to reconcile the internet gateway, failed to update: some error" ,
185+ wantErr : false ,
223186 },
224187 {
225188 name : "creation needed" ,
0 commit comments