From 62b750ca77820680ed4d7c9d562de0b2f99db8a7 Mon Sep 17 00:00:00 2001 From: Jordan Rodgers Date: Fri, 2 Aug 2024 11:02:44 -0700 Subject: [PATCH] requeue if not ready Signed-off-by: Jordan Rodgers --- controllers/rediscluster_controller.go | 2 +- controllers/redisreplication_controller.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/rediscluster_controller.go b/controllers/rediscluster_controller.go index 747678512..374d3791f 100644 --- a/controllers/rediscluster_controller.go +++ b/controllers/rediscluster_controller.go @@ -148,7 +148,7 @@ func (r *RedisClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request } if !(r.IsStatefulSetReady(ctx, r.K8sClient, instance, instance.Name+"-leader", instance.Namespace) && r.IsStatefulSetReady(ctx, r.K8sClient, instance, instance.Name+"-follower", instance.Namespace)) { - return intctrlutil.Reconciled() + return intctrlutil.RequeueAfter(reqLogger, time.Second*10, "Redis cluster is not ready") } // Mark the cluster status as bootstrapping if all the leader and follower nodes are ready diff --git a/controllers/redisreplication_controller.go b/controllers/redisreplication_controller.go index 9cd8f16e1..20fee1e59 100644 --- a/controllers/redisreplication_controller.go +++ b/controllers/redisreplication_controller.go @@ -58,7 +58,7 @@ func (r *RedisReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Req return intctrlutil.RequeueWithError(err, reqLogger, "") } if !r.IsStatefulSetReady(ctx, r.K8sClient, instance, instance.Name, instance.Namespace) { - return intctrlutil.Reconciled() + return intctrlutil.RequeueAfter(reqLogger, time.Second*10, "") } var realMaster string