fix: incorrect parsing broker_endpoints env variable (#3135)

This commit is contained in:
Weny Xu
2024-01-10 22:59:49 +09:00
committed by GitHub
parent b6033f62cd
commit 7fad4e8356
4 changed files with 15 additions and 3 deletions

View File

@@ -128,7 +128,7 @@ impl StartCommand {
let mut opts: MetaSrvOptions = Options::load_layered_options(
self.config_file.as_deref(),
self.env_prefix.as_ref(),
None,
MetaSrvOptions::env_list_keys(),
)?;
if let Some(dir) = &cli_options.log_dir {

View File

@@ -118,6 +118,12 @@ pub struct StandaloneOptions {
pub export_metrics: ExportMetricsOption,
}
impl StandaloneOptions {
pub fn env_list_keys() -> Option<&'static [&'static str]> {
Some(&["wal.broker_endpoints"])
}
}
impl Default for StandaloneOptions {
fn default() -> Self {
Self {
@@ -267,7 +273,7 @@ impl StartCommand {
let opts: StandaloneOptions = Options::load_layered_options(
self.config_file.as_deref(),
self.env_prefix.as_ref(),
None,
StandaloneOptions::env_list_keys(),
)?;
self.convert_options(cli_options, opts)

View File

@@ -276,7 +276,7 @@ impl Default for DatanodeOptions {
impl DatanodeOptions {
pub fn env_list_keys() -> Option<&'static [&'static str]> {
Some(&["meta_client.metasrv_addrs"])
Some(&["meta_client.metasrv_addrs", "wal.broker_endpoints"])
}
pub fn to_toml_string(&self) -> String {

View File

@@ -79,6 +79,12 @@ pub struct MetaSrvOptions {
pub store_key_prefix: String,
}
impl MetaSrvOptions {
pub fn env_list_keys() -> Option<&'static [&'static str]> {
Some(&["wal.broker_endpoints"])
}
}
impl Default for MetaSrvOptions {
fn default() -> Self {
Self {