diff --git a/internal/controllers/machine/machine_controller.go b/internal/controllers/machine/machine_controller.go index 268ce67f6e40..5b376b6e5b68 100644 --- a/internal/controllers/machine/machine_controller.go +++ b/internal/controllers/machine/machine_controller.go @@ -563,6 +563,7 @@ func (r *Reconciler) reconcileDelete(ctx context.Context, s *scope) (ctrl.Result hooks = append(hooks, key) } } + slices.Sort(hooks) log.Info("Waiting for pre-terminate hooks to succeed", "hooks", strings.Join(hooks, ",")) conditions.MarkFalse(m, clusterv1.PreTerminateDeleteHookSucceededCondition, clusterv1.WaitingExternalHookReason, clusterv1.ConditionSeverityInfo, "") s.deletingReason = clusterv1.MachineDeletingWaitingForPreTerminateHookV1Beta2Reason