@@ -302,10 +302,6 @@ func (r *MachinePoolReconciler) reconcileDeleteNodes(ctx context.Context, cluste
302
302
return nil
303
303
}
304
304
305
- if r .Tracker == nil {
306
- return errors .New ("Cannot establish cluster client to delete nodes" )
307
- }
308
-
309
305
clusterClient , err := r .Tracker .GetClient (ctx , util .ObjectKey (cluster ))
310
306
if err != nil {
311
307
return err
@@ -328,13 +324,9 @@ func (r *MachinePoolReconciler) isMachinePoolNodeDeleteTimeoutPassed(machinePool
328
324
// reconcileDeleteExternal tries to delete external references, returning true if it cannot find any.
329
325
func (r * MachinePoolReconciler ) reconcileDeleteExternal (ctx context.Context , machinePool * expv1.MachinePool ) (bool , error ) {
330
326
objects := []* unstructured.Unstructured {}
331
- references := []* corev1.ObjectReference {}
332
- // check for external ref
333
- if machinePool .Spec .Template .Spec .Bootstrap .ConfigRef != nil {
334
- references = append (references , machinePool .Spec .Template .Spec .Bootstrap .ConfigRef )
335
- }
336
- if machinePool .Spec .Template .Spec .InfrastructureRef != (corev1.ObjectReference {}) {
337
- references = append (references , & machinePool .Spec .Template .Spec .InfrastructureRef )
327
+ references := []* corev1.ObjectReference {
328
+ machinePool .Spec .Template .Spec .Bootstrap .ConfigRef ,
329
+ & machinePool .Spec .Template .Spec .InfrastructureRef ,
338
330
}
339
331
340
332
// Loop over the references and try to retrieve it with the client.
@@ -374,11 +366,6 @@ func (r *MachinePoolReconciler) watchClusterNodes(ctx context.Context, cluster *
374
366
return nil
375
367
}
376
368
377
- // If there is no tracker, don't watch remote nodes
378
- if r .Tracker == nil {
379
- return nil
380
- }
381
-
382
369
return r .Tracker .Watch (ctx , remote.WatchInput {
383
370
Name : "machinepool-watchNodes" ,
384
371
Cluster : util .ObjectKey (cluster ),
0 commit comments