Skip to content

Commit

Permalink
fix: ensure the config is provided before updating torii (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm authored Dec 3, 2024
1 parent 8eac17b commit d5d6026
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cli/src/command/deployments/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())?)?;

Expand Down

0 comments on commit d5d6026

Please sign in to comment.