diff --git a/internal/controllers/machinedeployment/machinedeployment_controller.go b/internal/controllers/machinedeployment/machinedeployment_controller.go index 64ac90c58d0f..03edc482858e 100644 --- a/internal/controllers/machinedeployment/machinedeployment_controller.go +++ b/internal/controllers/machinedeployment/machinedeployment_controller.go @@ -83,6 +83,7 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt err = ctrl.NewControllerManagedBy(mgr). For(&clusterv1.MachineDeployment{}). Owns(&clusterv1.MachineSet{}). + // Watches enqueues MachineDeployment for corresponding MachineSet resources, if no managed controller reference (owner) exists. Watches( &clusterv1.MachineSet{}, handler.EnqueueRequestsFromMapFunc(r.MachineSetToDeployments), diff --git a/internal/controllers/machineset/machineset_controller.go b/internal/controllers/machineset/machineset_controller.go index 58682dba2c7c..05c9d325a8ad 100644 --- a/internal/controllers/machineset/machineset_controller.go +++ b/internal/controllers/machineset/machineset_controller.go @@ -100,6 +100,7 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt err = ctrl.NewControllerManagedBy(mgr). For(&clusterv1.MachineSet{}). Owns(&clusterv1.Machine{}). + // Watches enqueues MachineSet for corresponding Machine resources, if no managed controller reference (owner) exists. Watches( &clusterv1.Machine{}, handler.EnqueueRequestsFromMapFunc(r.MachineToMachineSets),