Skip to content

Commit

Permalink
fix logs (#690)
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>
  • Loading branch information
shubham-cmyk authored Nov 8, 2023
1 parent 5bf8182 commit 1fd09c4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions controllers/rediscluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 1fd09c4

Please sign in to comment.