feat(home): add support for disabling cluster discovery in Redis configuration

This commit is contained in:
hkfires
2026-05-16 20:25:29 +08:00
parent 48104abf51
commit 644d5ea618
8 changed files with 96 additions and 6 deletions
+6 -5
View File
@@ -2,11 +2,12 @@ package config
// HomeConfig configures the optional "home" control plane integration over Redis protocol.
type HomeConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Host string `yaml:"host" json:"-"`
Port int `yaml:"port" json:"-"`
Password string `yaml:"password" json:"-"`
TLS HomeTLSConfig `yaml:"tls" json:"-"`
Enabled bool `yaml:"enabled" json:"enabled"`
Host string `yaml:"host" json:"-"`
Port int `yaml:"port" json:"-"`
Password string `yaml:"password" json:"-"`
DisableClusterDiscovery bool `yaml:"disable-cluster-discovery" json:"-"`
TLS HomeTLSConfig `yaml:"tls" json:"-"`
}
// HomeTLSConfig configures client-side TLS for the home Redis connection.
+4
View File
@@ -9,6 +9,7 @@ home:
host: home.example.com
port: 444
password: secret
disable-cluster-discovery: true
tls:
enable: true
server-name: home.example.com
@@ -31,6 +32,9 @@ home:
if cfg.Home.Password != "secret" {
t.Fatalf("Home.Password = %q, want secret", cfg.Home.Password)
}
if !cfg.Home.DisableClusterDiscovery {
t.Fatal("Home.DisableClusterDiscovery = false, want true")
}
if !cfg.Home.TLS.Enable {
t.Fatal("Home.TLS.Enable = false, want true")
}