Skip to content

Commit

Permalink
fix(meta): fix meta_endpoint format when host not provided in playgro…
Browse files Browse the repository at this point in the history
…und mode (risingwavelabs#7661)

Fix `meta_endpoint` format when `host` is not provided in playground mode, the endpoint will be wrongly generated as `127.0.0.1:5690:5690`.

Approved-By: lmatz
Approved-By: tabVersion
Approved-By: BugenZhao
  • Loading branch information
yezizp2012 authored Feb 2, 2023
1 parent e7fe72b commit 83e7f00
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/meta/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,13 @@ pub fn start(opts: MetaNodeOpts) -> Pin<Box<dyn Future<Output = ()> + Send>> {
let config = load_config(&opts.config_path, Some(opts.override_opts));
tracing::info!("Starting meta node with config {:?}", config);
let listen_addr: SocketAddr = opts.listen_addr.parse().unwrap();
let meta_addr = opts.host.unwrap_or_else(|| opts.listen_addr.clone());
let meta_addr = opts
.host
.map(|host| format!("{}:{}", host, listen_addr.port()))
.unwrap_or_else(|| opts.listen_addr.clone());
let dashboard_addr = opts.dashboard_host.map(|x| x.parse().unwrap());
let prometheus_addr = opts.prometheus_host.map(|x| x.parse().unwrap());
let meta_endpoint = opts
.meta_endpoint
.unwrap_or_else(|| format!("{}:{}", meta_addr, listen_addr.port()));
let meta_endpoint = opts.meta_endpoint.unwrap_or(meta_addr);
let backend = match config.meta.backend {
MetaBackend::Etcd => MetaStoreBackend::Etcd {
endpoints: opts
Expand Down

0 comments on commit 83e7f00

Please sign in to comment.