From b55ffbc2c4381d06092e6ef30e6d4c9b271cd1b3 Mon Sep 17 00:00:00 2001 From: Thibault Mange <22740367+thibaultmg@users.noreply.github.com> Date: Mon, 25 Mar 2024 09:41:36 +0100 Subject: [PATCH] Query-frontend: fix missing redis username config (#7224) * add username cfg to rueidis client Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com> * update changelog Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com> --------- Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com> --- CHANGELOG.md | 1 + internal/cortex/chunk/cache/redis_client.go | 2 ++ pkg/queryfrontend/config.go | 1 + 3 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c1b870068..046696862e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#7132](https://github.com/thanos-io/thanos/pull/7132) Documentation: fix broken helm installation instruction - [#7134](https://github.com/thanos-io/thanos/pull/7134) Store, Compact: Revert the recursive block listing mechanism introduced in https://github.com/thanos-io/thanos/pull/6474 and use the same strategy as in 0.31. Introduce a `--block-discovery-strategy` flag to control the listing strategy so that a recursive lister can still be used if the tradeoff of slower but cheaper discovery is preferred. - [#7122](https://github.com/thanos-io/thanos/pull/7122) Store Gateway: Fix lazy expanded postings estimate base cardinality using posting group with remove keys. +- [#7224](https://github.com/thanos-io/thanos/pull/7224) Query-frontend: Add Redis username to the client configuration. ### Added - [#7194](https://github.com/thanos-io/thanos/pull/7194) Downsample: retry objstore related errors diff --git a/internal/cortex/chunk/cache/redis_client.go b/internal/cortex/chunk/cache/redis_client.go index ac63ec3396..e118ac16d6 100644 --- a/internal/cortex/chunk/cache/redis_client.go +++ b/internal/cortex/chunk/cache/redis_client.go @@ -25,6 +25,7 @@ type RedisConfig struct { Timeout time.Duration `yaml:"timeout"` Expiration time.Duration `yaml:"expiration"` DB int `yaml:"db"` + Username string `yaml:"username"` Password flagext.Secret `yaml:"password"` EnableTLS bool `yaml:"tls_enabled"` InsecureSkipVerify bool `yaml:"tls_insecure_skip_verify"` @@ -54,6 +55,7 @@ func NewRedisClient(cfg *RedisConfig) (*RedisClient, error) { InitAddress: strings.Split(cfg.Endpoint, ","), ShuffleInit: true, Password: cfg.Password.Value, + Username: cfg.Username, SelectDB: cfg.DB, Dialer: net.Dialer{Timeout: cfg.Timeout}, ConnWriteTimeout: cfg.Timeout, diff --git a/pkg/queryfrontend/config.go b/pkg/queryfrontend/config.go index 176052bd33..437f0cf9ad 100644 --- a/pkg/queryfrontend/config.go +++ b/pkg/queryfrontend/config.go @@ -168,6 +168,7 @@ func NewCacheConfig(logger log.Logger, confContentYaml []byte) (*cortexcache.Con Expiration: config.Expiration, DB: config.Redis.DB, Password: flagext.Secret{Value: config.Redis.Password}, + Username: config.Redis.Username, }, Background: cortexcache.BackgroundConfig{ WriteBackBuffer: config.Redis.MaxSetMultiConcurrency * config.Redis.SetMultiBatchSize,