From 9349333672f9d305a98f0e113a4586bd168732bc Mon Sep 17 00:00:00 2001 From: glihm Date: Mon, 2 Dec 2024 16:48:43 -0600 Subject: [PATCH] fix: ensure the config is provided before updating torii --- cli/src/command/deployments/update.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cli/src/command/deployments/update.rs b/cli/src/command/deployments/update.rs index f631725..d34604d 100644 --- a/cli/src/command/deployments/update.rs +++ b/cli/src/command/deployments/update.rs @@ -55,6 +55,20 @@ impl UpdateArgs { } } UpdateServiceCommands::Torii(config) => { + // Enforce the use of the `--config` flag, to have the infra + // actually override the config file with the new behavior without relying + // on default values. + if config.torii_args.config.is_none() { + let describe_command = format!( + "slot deployments describe {project} torii", + project = self.project + ); + + return Err(anyhow::anyhow!( + "The `--config` flag is required to update the torii service and ensure the new configuration is applied. If you don't have a config file yet, you can use `{describe_command}` to inspect the current one." + )); + } + let service_config = toml::to_string(&ToriiArgsConfig::try_from(config.torii_args.clone())?)?;