File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ func (r *IonosCloudMachineReconciler) reconcileDelete(
215215
216216 if requeue {
217217 log .Info ("Deletion request is still in progress" )
218- return ctrl.Result {RequeueAfter : defaultReconcileDuration }, nil
218+ return ctrl.Result {RequeueAfter : reducedReconcileDuration }, nil
219219 }
220220
221221 reconcileSequence := []serviceReconcileStep [scope.Machine ]{
@@ -237,7 +237,6 @@ func (r *IonosCloudMachineReconciler) reconcileDelete(
237237 return ctrl.Result {RequeueAfter : defaultReconcileDuration }, err
238238 }
239239 }
240-
241240 controllerutil .RemoveFinalizer (machineScope .IonosMachine , infrav1 .MachineFinalizer )
242241 return ctrl.Result {}, nil
243242}
@@ -286,6 +285,12 @@ func (*IonosCloudMachineReconciler) checkRequestStates(
286285 return nil
287286 },
288287 )
288+
289+ // We need to patch the machine during the deletion phase to make sure we do
290+ // not have a diff in the status during the final patch when the finalizer is removed.
291+ if ! machineScope .IonosMachine .DeletionTimestamp .IsZero () {
292+ requeue , retErr = true , machineScope .PatchObject ()
293+ }
289294 }
290295 }
291296
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import (
3636
3737const (
3838 defaultReconcileDuration = time .Second * 20
39+ reducedReconcileDuration = time .Second * 10
3940)
4041
4142type serviceReconcileStep [T scope.Cluster | scope.Machine ] struct {
You can’t perform that action at this time.
0 commit comments