Skip to content

Commit

Permalink
Merge branch 'OT-CONTAINER-KIT:master' into add-master-selector-2
Browse files Browse the repository at this point in the history
  • Loading branch information
takara9 authored Feb 26, 2024
2 parents bd64ecd + db14d1b commit 9075a32
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions controllers/redisreplication_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ func (r *RedisReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Req
return ctrl.Result{RequeueAfter: time.Second * 60}, nil
}

reqLogger.Info("Creating redis replication by executing replication creation commands", "Replication.Ready", strconv.Itoa(int(redisReplicationInfo.Status.ReadyReplicas)))

if len(k8sutils.GetRedisNodesByRole(ctx, r.K8sClient, r.Log, instance, "master")) > int(leaderReplicas) {

reqLogger.Info("Creating redis replication by executing replication creation commands", "Replication.Ready", strconv.Itoa(int(redisReplicationInfo.Status.ReadyReplicas)))
masterNodes := k8sutils.GetRedisNodesByRole(ctx, r.K8sClient, r.Log, instance, "master")
slaveNodes := k8sutils.GetRedisNodesByRole(ctx, r.K8sClient, r.Log, instance, "slave")
err := k8sutils.CreateMasterSlaveReplication(ctx, r.K8sClient, r.Log, instance, masterNodes, slaveNodes)
Expand Down

0 comments on commit 9075a32

Please sign in to comment.