You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: Detaching a volume from a machine is possible, but it usually means a missconfiguration.
498
-
// We should show a warning and ask the user for confirmation and let it happen instead of failing here.
499
-
returnfmt.Errorf(
500
-
"machine %s [%s] has a volume mounted but app config does not specify a volume; "+
501
-
"remove the volume from the machine or add a [mounts] section to fly.toml",
502
-
m.ID, groupName,
503
-
)
498
+
msg:=fmt.Sprintf("Warning! machine %s [%s] has a volume mounted but app config does not specify a volume.\nThis usually indicates a misconfiguration.", m.ID, groupName)
499
+
fmt.Fprintln(md.io.ErrOut, md.colorize.Red(msg))
500
+
501
+
switchconfirmed, err:=prompt.Confirm(ctx, "Do you still want to continue and detach the volume? This will replace the machine."); {
502
+
caseerr==nil:
503
+
if!confirmed {
504
+
returnfmt.Errorf(
505
+
"deployment cancelled: machine %s [%s] has a volume mounted but app config does not specify a volume; "+
506
+
"remove the volume from the machine or add a [mounts] section to fly.toml",
507
+
m.ID, groupName,
508
+
)
509
+
}
510
+
caseprompt.IsNonInteractive(err):
511
+
returnprompt.NonInteractiveError("yes flag must be specified when not running interactively")
0 commit comments