Skip to content

Commit

Permalink
migrate-to-v2 debug: add confirm before switching to Nomad or V2
Browse files Browse the repository at this point in the history
  • Loading branch information
alichay committed Jun 2, 2023
1 parent c707697 commit c2155b6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions internal/command/migrate_to_v2/debug.go
Expand Up @@ -363,8 +363,28 @@ func fixDetachedApp(
return fmt.Errorf("could not list machines: %w", err)
}
case DestroyNomadUseMachines:
confirm := false
if err := survey.AskOne(&survey.Confirm{
Message: "Are you sure you want to remove existing Nomad VMs and switch to V2?",
}, &confirm); err != nil {
return err
}
if !confirm {
continue
}

return zeroNomadUseMachines(ctx, app, allocs)
case DestroyMachinesUseNomad:
confirm := false
if err := survey.AskOne(&survey.Confirm{
Message: "Are you sure you want to remove all Machines and switch back to Nomad?",
}, &confirm); err != nil {
return err
}
if !confirm {
continue
}

fmt.Fprint(io.Out, "Destroying machines and setting platform version to nomad.\n")

for _, mach := range machines {
Expand Down

0 comments on commit c2155b6

Please sign in to comment.