@@ -64,7 +64,7 @@ var _ = Describe("cluster-lifecycle", Ordered, Label("cluster", "cluster-lifecyc
64
64
},
65
65
}
66
66
67
- ctlrSuite := NewControllerTestSuite (mock.MockLinodeNodeBalancerClient {})
67
+ ctlrSuite := NewControllerTestSuite (GinkgoT (), mock.MockLinodeNodeBalancerClient {})
68
68
reconciler := LinodeClusterReconciler {
69
69
Recorder : ctlrSuite .Recorder (),
70
70
}
@@ -108,7 +108,7 @@ var _ = Describe("cluster-lifecycle", Ordered, Label("cluster", "cluster-lifecyc
108
108
NodeBalancerID : nodebalancerID ,
109
109
}, nil )
110
110
}),
111
- Case (
111
+ Path (
112
112
Call ("cluster is not created because there is no nb" , func (ctx context.Context , m Mock ) {
113
113
cScope .LinodeClient = m .NodeBalancerClient
114
114
getNB := m .NodeBalancerClient .EXPECT ().ListNodeBalancers (gomock .Any (), gomock .Any ()).Return (nil , nil )
@@ -121,7 +121,7 @@ var _ = Describe("cluster-lifecycle", Ordered, Label("cluster", "cluster-lifecyc
121
121
Expect (err .Error ()).To (ContainSubstring ("create NB error" ))
122
122
}),
123
123
),
124
- Case (
124
+ Path (
125
125
Call ("cluster is not created because there is no capl cluster" , func (ctx context.Context , m Mock ) {
126
126
cScope .LinodeClient = m .NodeBalancerClient
127
127
}),
@@ -184,6 +184,7 @@ var _ = Describe("cluster-delete", Ordered, Label("cluster", "cluster-delete"),
184
184
}
185
185
186
186
ctlrSuite := NewControllerTestSuite (
187
+ GinkgoT (),
187
188
mock.MockLinodeNodeBalancerClient {},
188
189
mock.MockK8sClient {},
189
190
)
@@ -202,21 +203,20 @@ var _ = Describe("cluster-delete", Ordered, Label("cluster", "cluster-delete"),
202
203
cScope .Client = m .K8sClient
203
204
m .NodeBalancerClient .EXPECT ().DeleteNodeBalancer (gomock .Any (), gomock .Any ()).Return (nil )
204
205
}),
205
- Case (
206
+ Path (
206
207
Call ("nothing to do because NB ID is nil" , func (ctx context.Context , m Mock ) {
207
208
cScope .Client = m .K8sClient
208
209
cScope .LinodeClient = m .NodeBalancerClient
209
210
cScope .LinodeCluster .Spec .Network .NodeBalancerID = nil
210
- // m.NodeBalancerClient.EXPECT().DeleteNodeBalancer(gomock.Any(), gomock.Any()).Return(nil)
211
211
}),
212
212
Result ("nothing to do because NB ID is nil" , func (ctx context.Context , m Mock ) {
213
213
reconciler .Client = m .K8sClient
214
214
err := reconciler .reconcileDelete (ctx , logr.Logger {}, cScope )
215
215
Expect (err ).NotTo (HaveOccurred ())
216
- Expect (<- m .Events ()).To (ContainSubstring ("Warning NodeBalancerIDMissing NodeBalancer ID is missing, nothing to do" ))
216
+ Expect (ctlrSuite .Events ()).To (ContainSubstring ("Warning NodeBalancerIDMissing NodeBalancer ID is missing, nothing to do" ))
217
217
}),
218
218
),
219
- Case (
219
+ Path (
220
220
Call ("cluster not deleted because the nb can't be deleted" , func (ctx context.Context , m Mock ) {
221
221
cScope .LinodeClient = m .NodeBalancerClient
222
222
cScope .Client = m .K8sClient
0 commit comments