Zanzana: Refactor remote client initialization (#114142)

* Zanzana: Refactor remote client

* rename config field URL to Addr

* Instrument grpc queries

* fix duplicated field
This commit is contained in:
Alexander Zobnin
2025-12-11 10:55:12 +01:00
committed by GitHub
parent d48455cd20
commit e2d12f4cce
6 changed files with 55 additions and 32 deletions
+12 -3
View File
@@ -110,15 +110,24 @@ func (cfg *Cfg) readZanzanaSettings() {
zc.Mode = "embedded"
}
zc.Token = clientSec.Key("token").MustString("")
zc.TokenExchangeURL = clientSec.Key("token_exchange_url").MustString("")
zc.Addr = clientSec.Key("address").MustString("")
zc.ServerCertFile = clientSec.Key("tls_cert").MustString("")
// TODO: read Token and TokenExchangeURL from grpc_client_authentication section
grpcClientAuthSection := cfg.SectionWithEnvOverrides("grpc_client_authentication")
zc.Token = grpcClientAuthSection.Key("token").MustString("")
zc.TokenExchangeURL = grpcClientAuthSection.Key("token_exchange_url").MustString("")
zc.TokenNamespace = grpcClientAuthSection.Key("token_namespace").MustString("stacks-" + cfg.StackID)
// TODO: remove old settings when migrated
token := clientSec.Key("token").MustString("")
tokenExchangeURL := clientSec.Key("token_exchange_url").MustString("")
if token != "" {
zc.Token = token
}
if tokenExchangeURL != "" {
zc.TokenExchangeURL = tokenExchangeURL
}
cfg.ZanzanaClient = zc
zs := ZanzanaServerSettings{}