Skip to content

Commit 727a546

Browse files
lentzi90k8s-infra-cherrypick-robot
authored andcommitted
Requeue when waiting for a server to be deleted
Signed-off-by: Lennart Jern <[email protected]>
1 parent 975d028 commit 727a546

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

controllers/openstackmachine_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ const (
6666
waitForClusterInfrastructureReadyDuration = 15 * time.Second
6767
waitForInstanceBecomeActiveToReconcile = 60 * time.Second
6868
waitForBuildingInstanceToReconcile = 10 * time.Second
69+
deleteServerRequeueDelay = 10 * time.Second
6970
)
7071

7172
// +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
265266
// If the server was found, we need to wait for it to be deleted before
266267
// removing the OpenStackMachine finalizer.
267268
scope.Logger().Info("Waiting for server to be deleted before removing finalizer")
268-
return ctrl.Result{}, nil
269+
return ctrl.Result{RequeueAfter: deleteServerRequeueDelay}, nil
269270
}
270271

271272
controllerutil.RemoveFinalizer(openStackMachine, infrav1.MachineFinalizer)

0 commit comments

Comments
 (0)