Skip to content

Commit

Permalink
chore: enhance log every reconcile redis replication
Browse files Browse the repository at this point in the history
Signed-off-by: drivebyer <[email protected]>
  • Loading branch information
drivebyer committed Feb 19, 2024
1 parent a143001 commit 35ff280
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)))

Check warning on line 82 in controllers/redisreplication_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/redisreplication_controller.go#L82

Added line #L82 was not covered by tests
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 35ff280

Please sign in to comment.