refactor(maestro): wire --config flag through to maestro registry
ci / rust (push) Failing after 2m13s
ci / rust (pull_request) Successful in 4m54s

`registry::run` now accepts an `Option<PathBuf>` config override so the
umbrella binary's `--config` flag (and its clap-bound `MAESTRO_CONFIG`
env var) reach the registry, mirroring how the daemon already consumed
the override.
This commit is contained in:
2026-05-27 10:45:16 +00:00
parent ade0d49096
commit 9ce6303293
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -9,13 +9,14 @@ use std::path::PathBuf;
use tokio::net::TcpListener;
use crate::{
default_config_path, load_config, router, Registry, CONFIG_PATH_ENV, ENV_REGISTRY_BIND_ADDR,
ENV_TOKEN,
default_config_path, load_config, router, Registry, ENV_REGISTRY_BIND_ADDR, ENV_TOKEN,
};
pub async fn run() -> Result<(), Box<dyn Error>> {
let config_path: PathBuf = match std::env::var_os(CONFIG_PATH_ENV) {
Some(p) => PathBuf::from(p),
/// Run the registry. `config_override` is the top-level `--config` flag from
/// the umbrella binary (also populated from `$MAESTRO_CONFIG` by clap).
pub async fn run(config_override: Option<PathBuf>) -> Result<(), Box<dyn Error>> {
let config_path: PathBuf = match config_override {
Some(p) => p,
None => default_config_path()?,
};
let env_token = std::env::var(ENV_TOKEN).ok();
+1 -1
View File
@@ -152,7 +152,7 @@ async fn dispatch(cli: Cli) -> Result<(), Box<dyn std::error::Error>> {
#[cfg(feature = "daemon")]
Command::Daemon { cmd } => maestro_daemon::cli::dispatch(cli.config, cmd).await?,
#[cfg(feature = "registry")]
Command::Registry => maestro_registry::run().await?,
Command::Registry => maestro_registry::run(cli.config).await?,
}
Ok(())
}