Skip to main content

run_migrate

Function run_migrate 

Source
pub fn run_migrate(
    ctx: &Context,
    dry_run: bool,
    force: bool,
    skip_backup: bool,
    stdout: &mut dyn Write,
    confirm: &mut dyn FnMut(&str) -> Result<bool>,
) -> Result<()>
Expand description

Port of config.runMigrate: computes the migration plan once, then either previews it (--dry-run), confirms with the user (unless --force), or writes it to disk with a .bak backup (unless --skip-backup).

confirm mirrors Go’s pterm.DefaultInteractiveConfirm.Show() as an injected closure (taking the prompt text, returning the user’s yes/no answer) rather than a hard-wired terminal read, so this is directly testable without a real TTY – the same injected-behavior pattern up/ca/deploy/run use for their Connector/KubectlFactory parameters (see PORT_NOTES.md).