@@ -109,23 +109,36 @@ var _ = Describe("cluster-lifecycle", Ordered, Label("cluster", "cluster-lifecyc
109
109
}, nil )
110
110
}),
111
111
Path (
112
- Call ("cluster is not created because there is no nb" , func (ctx context.Context , m Mock ) {
112
+ Call ("cluster is not created because there was an error creating 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 )
115
115
m .NodeBalancerClient .EXPECT ().CreateNodeBalancer (gomock .Any (), gomock .Any ()).
116
116
After (getNB ).
117
117
Return (nil , errors .New ("create NB error" ))
118
118
}),
119
- Result ("error" , func (ctx context.Context , m Mock ) {
119
+ Result ("create nb error" , func (ctx context.Context , m Mock ) {
120
120
_ , err := reconciler .reconcile (ctx , cScope , logr.Logger {})
121
121
Expect (err .Error ()).To (ContainSubstring ("create NB error" ))
122
122
}),
123
123
),
124
+ Path (
125
+ Call ("cluster is not created because nb was nil" , func (ctx context.Context , m Mock ) {
126
+ cScope .LinodeClient = m .NodeBalancerClient
127
+ getNB := m .NodeBalancerClient .EXPECT ().ListNodeBalancers (gomock .Any (), gomock .Any ()).Return (nil , nil )
128
+ m .NodeBalancerClient .EXPECT ().CreateNodeBalancer (gomock .Any (), gomock .Any ()).
129
+ After (getNB ).
130
+ Return (nil , nil )
131
+ }),
132
+ Result ("created nb is nil" , func (ctx context.Context , m Mock ) {
133
+ _ , err := reconciler .reconcile (ctx , cScope , logr.Logger {})
134
+ Expect (err .Error ()).To (ContainSubstring ("nodeBalancer created was nil" ))
135
+ }),
136
+ ),
124
137
Path (
125
138
Call ("cluster is not created because there is no capl cluster" , func (ctx context.Context , m Mock ) {
126
139
cScope .LinodeClient = m .NodeBalancerClient
127
140
}),
128
- Result ("error" , func (ctx context.Context , m Mock ) {
141
+ Result ("no capl cluster error" , func (ctx context.Context , m Mock ) {
129
142
reconciler .Client = k8sClient
130
143
_ , err := reconciler .Reconcile (ctx , reconcile.Request {
131
144
NamespacedName : client .ObjectKeyFromObject (cScope .LinodeCluster ),
0 commit comments