Skip to content

Commit b413ab8

Browse files
authored
more sentinel tweaks (#33)
1 parent 05ead22 commit b413ab8

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

pkg/metadata.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func NewBlobCacheMetadata(cfg MetadataConfig) (*BlobCacheMetadata, error) {
3131
Addrs: []string{cfg.RedisAddr},
3232
Mode: redisMode,
3333
Password: cfg.RedisPasswd,
34+
SentinelPassword: cfg.RedisPasswd,
3435
EnableTLS: cfg.RedisTLSEnabled,
3536
MasterName: cfg.RedisMasterName,
3637
InsecureSkipVerify: true, // HOTFIX: tailscale certs don't match in-cluster certs

pkg/redis_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,16 @@ func Test_CopyConfig(t *testing.T) {
5454
name: "sentinel config",
5555
sentinel: true,
5656
inputConfig: RedisConfig{
57-
Addrs: []string{"localhost:26379"},
58-
MasterName: "mymaster",
59-
RouteByLatency: true,
57+
Addrs: []string{"localhost:26379"},
58+
MasterName: "mymaster",
59+
RouteByLatency: true,
60+
Password: "password",
61+
SentinelPassword: "sentinel_password",
6062
},
6163
expectedOptions: redis.UniversalOptions{
6264
Addrs: []string{"localhost:26379"},
6365
MasterName: "mymaster",
66+
Password: "password",
6467
},
6568
},
6669
}
@@ -82,6 +85,7 @@ func Test_CopyConfig(t *testing.T) {
8285
failoverOpts := actualOptions.Failover()
8386
assert.Equal(t, test.inputConfig.Addrs[0], failoverOpts.SentinelAddrs[0])
8487
assert.Equal(t, test.inputConfig.MasterName, failoverOpts.MasterName)
88+
assert.Equal(t, test.inputConfig.SentinelPassword, failoverOpts.SentinelPassword)
8589
}
8690
})
8791
}

pkg/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ type RedisConfig struct {
9292
Password string `key:"password" json:"password"`
9393
RouteByLatency bool `key:"routeByLatency" json:"route_by_latency"`
9494
MasterName string `key:"masterName" json:"master_name"`
95+
SentinelPassword string `key:"sentinelPassword" json:"sentinel_password"`
9596
}
9697

9798
type BlobFsConfig struct {

0 commit comments

Comments
 (0)