Skip to content

Commit

Permalink
fix: Authentication issue with sentinel=true (#870)
Browse files Browse the repository at this point in the history
  • Loading branch information
silentdark authored Oct 14, 2024
1 parent 94d36b0 commit 0f42759
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/client/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ type Redis struct {
protoWriter *proto.Writer
}

func NewSentinelMasterClient(ctx context.Context, address string, Tls bool) *Redis {
return NewRedisClient(ctx, address, "", "", Tls, false)
func NewSentinelMasterClient(ctx context.Context, address string, username string, password string, Tls bool) *Redis {
return NewRedisClient(ctx, address, username, password, Tls, false)
}

func NewRedisClient(ctx context.Context, address string, username string, password string, Tls bool, replica bool) *Redis {
Expand Down
2 changes: 1 addition & 1 deletion internal/writer/redis_sentinel_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func NewRedisSentinelWriter(ctx context.Context, opts *RedisWriterOptions) Writer {
sentinel := client.NewSentinelMasterClient(ctx, opts.Address, opts.Tls)
sentinel := client.NewSentinelMasterClient(ctx, opts.Address, opts.Username, opts.Password, opts.Tls)
sentinel.Send("SENTINEL", "GET-MASTER-ADDR-BY-NAME", opts.Master)
addr, err := sentinel.Receive()
if err != nil {
Expand Down

0 comments on commit 0f42759

Please sign in to comment.