From 0508759402f8b21e591e64fa99344e15631cb1d2 Mon Sep 17 00:00:00 2001 From: Lennart Jern Date: Thu, 14 Nov 2024 13:55:28 +0200 Subject: [PATCH] Requeue when waiting for a server to be deleted Signed-off-by: Lennart Jern --- controllers/openstackmachine_controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/openstackmachine_controller.go b/controllers/openstackmachine_controller.go index 6c8f3c0a2a..3de18d0dc5 100644 --- a/controllers/openstackmachine_controller.go +++ b/controllers/openstackmachine_controller.go @@ -66,6 +66,7 @@ const ( waitForClusterInfrastructureReadyDuration = 15 * time.Second waitForInstanceBecomeActiveToReconcile = 60 * time.Second waitForBuildingInstanceToReconcile = 10 * time.Second + deleteServerRequeueDelay = 10 * time.Second ) // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=openstackmachines,verbs=get;list;watch;create;update;patch;delete @@ -265,7 +266,7 @@ func (r *OpenStackMachineReconciler) reconcileDelete(ctx context.Context, scope // If the server was found, we need to wait for it to be deleted before // removing the OpenStackMachine finalizer. scope.Logger().Info("Waiting for server to be deleted before removing finalizer") - return ctrl.Result{}, nil + return ctrl.Result{RequeueAfter: deleteServerRequeueDelay}, nil } controllerutil.RemoveFinalizer(openStackMachine, infrav1.MachineFinalizer)