mirror of
https://github.com/redis/go-redis.git
synced 2025-08-07 12:42:55 +03:00
feat: support Elasticache cluster mode by introducing IsClusterMode config param (#3255)
Co-authored-by: Rushikesh Joshi <rushikesh.joshi@sap.com> Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
This commit is contained in:
@@ -60,4 +60,21 @@ var _ = Describe("UniversalClient", func() {
|
||||
a := func() { client.FTInfo(ctx, "all").Result() }
|
||||
Expect(a).ToNot(Panic())
|
||||
})
|
||||
|
||||
It("should connect to clusters if IsClusterMode is set even if only a single address is provided", Label("NonRedisEnterprise"), func() {
|
||||
client = redis.NewUniversalClient(&redis.UniversalOptions{
|
||||
Addrs: []string{cluster.addrs()[0]},
|
||||
IsClusterMode: true,
|
||||
})
|
||||
_, ok := client.(*redis.ClusterClient)
|
||||
Expect(ok).To(BeTrue(), "expected a ClusterClient")
|
||||
})
|
||||
|
||||
It("should return all slots after instantiating UniversalClient with IsClusterMode", Label("NonRedisEnterprise"), func() {
|
||||
client = redis.NewUniversalClient(&redis.UniversalOptions{
|
||||
Addrs: []string{cluster.addrs()[0]},
|
||||
IsClusterMode: true,
|
||||
})
|
||||
Expect(client.ClusterSlots(ctx).Val()).To(HaveLen(3))
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user