diff --git a/controllers/redissentinel_controller.go b/controllers/redissentinel_controller.go index a3c4fe53c..f817abccb 100644 --- a/controllers/redissentinel_controller.go +++ b/controllers/redissentinel_controller.go @@ -45,11 +45,6 @@ func (r *RedisSentinelReconciler) Reconcile(ctx context.Context, req ctrl.Reques return ctrl.Result{RequeueAfter: time.Second * 10}, nil } - if instance.Spec.RedisSentinelConfig != nil && !k8sutils.IsRedisReplicationReady(ctx, reqLogger, r.K8sClient, r.Dk8sClient, instance) { - reqLogger.Info("Redis Replication is specified but not ready, so will reconcile again in 10 seconds") - return ctrl.Result{RequeueAfter: time.Second * 10}, nil - } - // Get total Sentinel Replicas // sentinelReplicas := instance.Spec.GetSentinelCounts("sentinel") @@ -61,6 +56,11 @@ func (r *RedisSentinelReconciler) Reconcile(ctx context.Context, req ctrl.Reques return ctrl.Result{RequeueAfter: time.Second * 60}, err } + if instance.Spec.RedisSentinelConfig != nil && !k8sutils.IsRedisReplicationReady(ctx, reqLogger, r.K8sClient, r.Dk8sClient, instance) { + reqLogger.Info("Redis Replication is specified but not ready, so will reconcile again in 10 seconds") + return ctrl.Result{RequeueAfter: time.Second * 10}, nil + } + // Create Redis Sentinel err = k8sutils.CreateRedisSentinel(ctx, r.K8sClient, r.Log, instance, r.K8sClient, r.Dk8sClient) if err != nil {