From 1fd09c40a92538aeb8957b7d7a32762b08338c0b Mon Sep 17 00:00:00 2001 From: Shubham Gupta <69793468+shubham-cmyk@users.noreply.github.com> Date: Wed, 8 Nov 2023 13:53:16 +0530 Subject: [PATCH] fix logs (#690) Signed-off-by: Shubham Gupta --- controllers/rediscluster_controller.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/controllers/rediscluster_controller.go b/controllers/rediscluster_controller.go index 930f1fcae..91560bb36 100644 --- a/controllers/rediscluster_controller.go +++ b/controllers/rediscluster_controller.go @@ -120,7 +120,10 @@ func (r *RedisClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request redisLeaderInfo, err := k8sutils.GetStatefulSet(instance.Namespace, instance.ObjectMeta.Name+"-leader") if err != nil { - return ctrl.Result{RequeueAfter: time.Second * 60}, err + if errors.IsNotFound(err) { + return ctrl.Result{RequeueAfter: time.Second * 60}, nil + } + return ctrl.Result{}, err } if int32(redisLeaderInfo.Status.ReadyReplicas) == leaderReplicas { @@ -151,7 +154,10 @@ func (r *RedisClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request } redisFollowerInfo, err := k8sutils.GetStatefulSet(instance.Namespace, instance.ObjectMeta.Name+"-follower") if err != nil { - return ctrl.Result{RequeueAfter: time.Second * 60}, err + if errors.IsNotFound(err) { + return ctrl.Result{RequeueAfter: time.Second * 60}, nil + } + return ctrl.Result{}, err } if leaderReplicas == 0 {