canic-host 0.70.16

Host-side build, install, deployment, and fleet-template library for Canic workspaces
Documentation
use super::{
    options::InstallRootOptions, state::validate_state_name,
    truth_check::validate_expected_fleet_name,
};
use crate::release_set::configured_fleet_name;
use std::path::Path;

pub(super) fn resolve_install_identity(
    options: &InstallRootOptions,
    config_path: &Path,
) -> Result<(String, String), Box<dyn std::error::Error>> {
    let fleet_name = configured_fleet_name(config_path)?;
    validate_expected_fleet_name(options.expected_fleet.as_deref(), &fleet_name, config_path)?;
    validate_state_name(&fleet_name)?;
    let deployment_name = options
        .deployment_name
        .clone()
        .unwrap_or_else(|| fleet_name.clone());
    validate_state_name(&deployment_name)?;
    Ok((fleet_name, deployment_name))
}