From 390df7c952259132b254c615f7e736f754a21240 Mon Sep 17 00:00:00 2001 From: drivebyer Date: Thu, 26 Oct 2023 21:53:15 +0800 Subject: [PATCH] fix wait follower statefulset ready before make cluster Signed-off-by: drivebyer --- controllers/rediscluster_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/rediscluster_controller.go b/controllers/rediscluster_controller.go index 98530728d..930f1fcae 100644 --- a/controllers/rediscluster_controller.go +++ b/controllers/rediscluster_controller.go @@ -159,7 +159,7 @@ func (r *RedisClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request return ctrl.Result{RequeueAfter: time.Second * 120}, nil } - if int32(redisLeaderInfo.Status.ReadyReplicas) != leaderReplicas && int32(redisFollowerInfo.Status.ReadyReplicas) != followerReplicas { + if !(redisLeaderInfo.Status.ReadyReplicas == leaderReplicas && redisFollowerInfo.Status.ReadyReplicas == followerReplicas) { reqLogger.Info("Redis leader and follower nodes are not ready yet", "Ready.Replicas", strconv.Itoa(int(redisLeaderInfo.Status.ReadyReplicas)), "Expected.Replicas", leaderReplicas) return ctrl.Result{RequeueAfter: time.Second * 120}, nil }