From f4abc731d821a888a19bc1de6ec751f155a4bdb0 Mon Sep 17 00:00:00 2001 From: Benjamin Ziehms Date: Tue, 20 Feb 2024 14:29:13 +0000 Subject: [PATCH 1/2] typo: fix DisableIndentity -> DisableIdentity typo --- bench_decode_test.go | 4 ++-- options.go | 2 +- osscluster.go | 26 +++++++++++++------------- redis.go | 2 +- ring.go | 8 ++++---- sentinel.go | 8 ++++---- universal.go | 16 ++++++++-------- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/bench_decode_test.go b/bench_decode_test.go index 16bdf2cd3..d61a901a0 100644 --- a/bench_decode_test.go +++ b/bench_decode_test.go @@ -30,7 +30,7 @@ func NewClientStub(resp []byte) *ClientStub { Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) { return stub.stubConn(initHello), nil }, - DisableIndentity: true, + DisableIdentity: true, }) return stub } @@ -46,7 +46,7 @@ func NewClusterClientStub(resp []byte) *ClientStub { Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) { return stub.stubConn(initHello), nil }, - DisableIndentity: true, + DisableIdentity: true, ClusterSlots: func(_ context.Context) ([]ClusterSlot, error) { return []ClusterSlot{ diff --git a/options.go b/options.go index dff52ae8b..1409b0694 100644 --- a/options.go +++ b/options.go @@ -143,7 +143,7 @@ type Options struct { readOnly bool // Disable set-lib on connect. Default is false. - DisableIndentity bool + DisableIdentity bool // Add suffix to client name. Default is empty. IdentitySuffix string diff --git a/osscluster.go b/osscluster.go index 17f98d9dc..97276fb80 100644 --- a/osscluster.go +++ b/osscluster.go @@ -85,8 +85,8 @@ type ClusterOptions struct { ConnMaxIdleTime time.Duration ConnMaxLifetime time.Duration - TLSConfig *tls.Config - DisableIndentity bool // Disable set-lib on connect. Default is false. + TLSConfig *tls.Config + DisableIdentity bool // Disable set-lib on connect. Default is false. IdentitySuffix string // Add suffix to client name. Default is empty. } @@ -286,17 +286,17 @@ func (opt *ClusterOptions) clientOptions() *Options { WriteTimeout: opt.WriteTimeout, ContextTimeoutEnabled: opt.ContextTimeoutEnabled, - PoolFIFO: opt.PoolFIFO, - PoolSize: opt.PoolSize, - PoolTimeout: opt.PoolTimeout, - MinIdleConns: opt.MinIdleConns, - MaxIdleConns: opt.MaxIdleConns, - MaxActiveConns: opt.MaxActiveConns, - ConnMaxIdleTime: opt.ConnMaxIdleTime, - ConnMaxLifetime: opt.ConnMaxLifetime, - DisableIndentity: opt.DisableIndentity, - IdentitySuffix: opt.IdentitySuffix, - TLSConfig: opt.TLSConfig, + PoolFIFO: opt.PoolFIFO, + PoolSize: opt.PoolSize, + PoolTimeout: opt.PoolTimeout, + MinIdleConns: opt.MinIdleConns, + MaxIdleConns: opt.MaxIdleConns, + MaxActiveConns: opt.MaxActiveConns, + ConnMaxIdleTime: opt.ConnMaxIdleTime, + ConnMaxLifetime: opt.ConnMaxLifetime, + DisableIdentity: opt.DisableIdentity, + IdentitySuffix: opt.IdentitySuffix, + TLSConfig: opt.TLSConfig, // If ClusterSlots is populated, then we probably have an artificial // cluster whose nodes are not in clustering mode (otherwise there isn't // much use for ClusterSlots config). This means we cannot execute the diff --git a/redis.go b/redis.go index 33477b53a..0e6fedd14 100644 --- a/redis.go +++ b/redis.go @@ -334,7 +334,7 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error { pipe.ClientSetName(ctx, c.opt.ClientName) } - if !c.opt.DisableIndentity { + if !c.opt.DisableIdentity { libName := "" libVer := Version() if c.opt.IdentitySuffix != "" { diff --git a/ring.go b/ring.go index 4ae00542b..9dd63bdfb 100644 --- a/ring.go +++ b/ring.go @@ -98,8 +98,8 @@ type RingOptions struct { TLSConfig *tls.Config Limiter Limiter - DisableIndentity bool - IdentitySuffix string + DisableIdentity bool + IdentitySuffix string } func (opt *RingOptions) init() { @@ -166,8 +166,8 @@ func (opt *RingOptions) clientOptions() *Options { TLSConfig: opt.TLSConfig, Limiter: opt.Limiter, - DisableIndentity: opt.DisableIndentity, - IdentitySuffix: opt.IdentitySuffix, + DisableIdentity: opt.DisableIdentity, + IdentitySuffix: opt.IdentitySuffix, } } diff --git a/sentinel.go b/sentinel.go index 9ace0886b..4d90e1c71 100644 --- a/sentinel.go +++ b/sentinel.go @@ -80,8 +80,8 @@ type FailoverOptions struct { TLSConfig *tls.Config - DisableIndentity bool - IdentitySuffix string + DisableIdentity bool + IdentitySuffix string } func (opt *FailoverOptions) clientOptions() *Options { @@ -117,8 +117,8 @@ func (opt *FailoverOptions) clientOptions() *Options { TLSConfig: opt.TLSConfig, - DisableIndentity: opt.DisableIndentity, - IdentitySuffix: opt.IdentitySuffix, + DisableIdentity: opt.DisableIdentity, + IdentitySuffix: opt.IdentitySuffix, } } diff --git a/universal.go b/universal.go index 275bef3d6..2c3e26d6e 100644 --- a/universal.go +++ b/universal.go @@ -66,8 +66,8 @@ type UniversalOptions struct { MasterName string - DisableIndentity bool - IdentitySuffix string + DisableIdentity bool + IdentitySuffix string } // Cluster returns cluster options created from the universal options. @@ -112,8 +112,8 @@ func (o *UniversalOptions) Cluster() *ClusterOptions { TLSConfig: o.TLSConfig, - DisableIndentity: o.DisableIndentity, - IdentitySuffix: o.IdentitySuffix, + DisableIdentity: o.DisableIdentity, + IdentitySuffix: o.IdentitySuffix, } } @@ -158,8 +158,8 @@ func (o *UniversalOptions) Failover() *FailoverOptions { TLSConfig: o.TLSConfig, - DisableIndentity: o.DisableIndentity, - IdentitySuffix: o.IdentitySuffix, + DisableIdentity: o.DisableIdentity, + IdentitySuffix: o.IdentitySuffix, } } @@ -201,8 +201,8 @@ func (o *UniversalOptions) Simple() *Options { TLSConfig: o.TLSConfig, - DisableIndentity: o.DisableIndentity, - IdentitySuffix: o.IdentitySuffix, + DisableIdentity: o.DisableIdentity, + IdentitySuffix: o.IdentitySuffix, } } From 3009c8fcb1df4aab7002f7cdd766f7b1b4651c86 Mon Sep 17 00:00:00 2001 From: Benjamin Ziehms Date: Tue, 20 Feb 2024 14:37:00 +0000 Subject: [PATCH 2/2] fix: forward DisableIdentity and IdentitySuffix in sentinelOptions and clusterOptions --- sentinel.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sentinel.go b/sentinel.go index 4d90e1c71..fa124b0d2 100644 --- a/sentinel.go +++ b/sentinel.go @@ -153,6 +153,9 @@ func (opt *FailoverOptions) sentinelOptions(addr string) *Options { ConnMaxLifetime: opt.ConnMaxLifetime, TLSConfig: opt.TLSConfig, + + DisableIdentity: opt.DisableIdentity, + IdentitySuffix: opt.IdentitySuffix, } } @@ -190,6 +193,9 @@ func (opt *FailoverOptions) clusterOptions() *ClusterOptions { ConnMaxLifetime: opt.ConnMaxLifetime, TLSConfig: opt.TLSConfig, + + DisableIdentity: opt.DisableIdentity, + IdentitySuffix: opt.IdentitySuffix, } }