@@ -152,9 +152,8 @@ func TestKubeadmConfigReconciler_Reconcile_ReturnEarlyIfMachineHasBootstrapData(
152
152
}
153
153
}
154
154
155
- // This returns an error since nothing can proceed without an associated cluster.
156
- // TODO: This should probably not return an error
157
- func TestKubeadmConfigReconciler_Reconcile_ReturnErrorIfMachineDoesNotHaveAssociatedCluster (t * testing.T ) {
155
+ // This does not expect an error, hoping the machine gets updated with a cluster
156
+ func TestKubeadmConfigReconciler_Reconcile_ReturnNilIfMachineDoesNotHaveAssociatedCluster (t * testing.T ) {
158
157
machine := newMachine (nil , "machine" ) // intentionally omitting cluster
159
158
config := newKubeadmConfig (machine , "cfg" )
160
159
@@ -176,14 +175,13 @@ func TestKubeadmConfigReconciler_Reconcile_ReturnErrorIfMachineDoesNotHaveAssoci
176
175
},
177
176
}
178
177
_ , err := k .Reconcile (request )
179
- if err = = nil {
180
- t .Fatal ("Expected error, got nil " )
178
+ if err ! = nil {
179
+ t .Fatal ("Not Expecting error, got an error " )
181
180
}
182
181
}
183
182
184
- // If the associated cluster is not found then there is no way to proceed.
185
- // TODO: This should probably not be an error
186
- func TestKubeadmConfigReconciler_Reconcile_ReturnErrorIfAssociatedClusterIsNotFound (t * testing.T ) {
183
+ // This does not expect an error, hoping that the associated cluster will be created
184
+ func TestKubeadmConfigReconciler_Reconcile_ReturnNilIfAssociatedClusterIsNotFound (t * testing.T ) {
187
185
cluster := newCluster ("cluster" )
188
186
machine := newMachine (cluster , "machine" )
189
187
config := newKubeadmConfig (machine , "cfg" )
@@ -207,8 +205,8 @@ func TestKubeadmConfigReconciler_Reconcile_ReturnErrorIfAssociatedClusterIsNotFo
207
205
},
208
206
}
209
207
_ , err := k .Reconcile (request )
210
- if err = = nil {
211
- t .Fatal ("Expected error, got nil " )
208
+ if err ! = nil {
209
+ t .Fatal ("Not Expecting error, got an error " )
212
210
}
213
211
}
214
212
0 commit comments