Skip to main content

plan_migration

Function plan_migration 

Source
pub fn plan_migration(
    cfg: &CloudConfig,
    workload: &str,
    to_group: &str,
    observed: &[String],
) -> Result<MigrationPlan, MigrationRefusal>
Expand description

Plan the move of workload into sovereign group to_group.

observed is the set of machine names the workload is currently live on, as seen by the caller — the CLI either probes the fleet or takes it from --from. It is an input rather than something this function discovers so the planner stays pure: same TOML plus same observation ⇒ same plan, with no network in the middle.

Returns MigrationRefusal rather than a bare error because every refusal is a distinct, actionable diagnosis and callers (and tests) should be able to match on which one fired.