Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-09-15 00:11:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-09-15 00:11:21 +0300
commitfdb478e6f3ac1a370123df6b92dbd331b46a7558 (patch)
tree2f2f420f510449728d183d3da5ecf28914ada989 /workhorse
parenta845362ebc7e14d2098223107d58625bb9423164 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'workhorse')
-rw-r--r--workhorse/config_test.go2
-rw-r--r--workhorse/internal/config/config.go15
-rw-r--r--workhorse/internal/goredis/goredis.go9
3 files changed, 15 insertions, 11 deletions
diff --git a/workhorse/config_test.go b/workhorse/config_test.go
index a6a1bdd7187..64f0a24d148 100644
--- a/workhorse/config_test.go
+++ b/workhorse/config_test.go
@@ -34,6 +34,7 @@ trusted_cidrs_for_propagation = ["10.0.0.1/8"]
[redis]
password = "redis password"
+SentinelPassword = "sentinel password"
[object_storage]
provider = "test provider"
[image_resizer]
@@ -68,6 +69,7 @@ key = "/path/to/private/key"
// fields in each section; that should happen in the tests of the
// internal/config package.
require.Equal(t, "redis password", cfg.Redis.Password)
+ require.Equal(t, "sentinel password", cfg.Redis.SentinelPassword)
require.Equal(t, "test provider", cfg.ObjectStorageCredentials.Provider)
require.Equal(t, uint32(123), cfg.ImageResizerConfig.MaxScalerProcs, "image resizer max_scaler_procs")
require.Equal(t, []string{"127.0.0.1/8", "192.168.0.1/8"}, cfg.TrustedCIDRsForXForwardedFor)
diff --git a/workhorse/internal/config/config.go b/workhorse/internal/config/config.go
index 687986974a3..3b928d42fe1 100644
--- a/workhorse/internal/config/config.go
+++ b/workhorse/internal/config/config.go
@@ -83,13 +83,14 @@ type GoogleCredentials struct {
}
type RedisConfig struct {
- URL TomlURL
- Sentinel []TomlURL
- SentinelMaster string
- Password string
- DB *int
- MaxIdle *int
- MaxActive *int
+ URL TomlURL
+ Sentinel []TomlURL
+ SentinelMaster string
+ SentinelPassword string
+ Password string
+ DB *int
+ MaxIdle *int
+ MaxActive *int
}
type ImageResizerConfig struct {
diff --git a/workhorse/internal/goredis/goredis.go b/workhorse/internal/goredis/goredis.go
index cd25c7ca60e..13a9d4cc34f 100644
--- a/workhorse/internal/goredis/goredis.go
+++ b/workhorse/internal/goredis/goredis.go
@@ -157,10 +157,11 @@ func configureSentinel(cfg *config.RedisConfig) *redis.Client {
}
client := redis.NewFailoverClient(&redis.FailoverOptions{
- MasterName: cfg.SentinelMaster,
- SentinelAddrs: sentinels,
- Password: cfg.Password,
- DB: getOrDefault(cfg.DB, 0),
+ MasterName: cfg.SentinelMaster,
+ SentinelAddrs: sentinels,
+ Password: cfg.Password,
+ SentinelPassword: cfg.SentinelPassword,
+ DB: getOrDefault(cfg.DB, 0),
PoolSize: getOrDefault(cfg.MaxActive, defaultMaxActive),
MaxIdleConns: getOrDefault(cfg.MaxIdle, defaultMaxIdle),