Skip to content

Commit

Permalink
cluster: print more clear warning when scale in with --force
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis committed Jul 8, 2021
1 parent 297b19c commit 9f44afc
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions pkg/cluster/manager/scale_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,24 @@ func (m *Manager) ScaleIn(
nodes []string = gOpt.Nodes
)
if !skipConfirm {
if err := tui.PromptForConfirmOrAbortError(
"This operation will delete the %s nodes in `%s` and all their data.\nDo you want to continue? [y/N]:",
strings.Join(nodes, ","),
color.HiYellowString(name)); err != nil {
return err
}

if force {
if err := tui.PromptForConfirmOrAbortError(
"Forcing scale in is unsafe and may result in data lost for stateful components.\nDo you want to continue? [y/N]:",
color.HiRedString("Forcing scale in is unsafe and may result in data loss for stateful components.\n"+
"The process is irreversible and could NOT be cancelled.\n") +
"Only use `--force` when some of the servers are already permanently offline.\n" +
"Are you sure to continue? [y/N]:",
); err != nil {
return err
}
}

if err := tui.PromptForConfirmOrAbortError(
"This operation will delete the %s nodes in `%s` and all their data.\nDo you want to continue? [y/N]:",
strings.Join(nodes, ","),
color.HiYellowString(name)); err != nil {
return err
}

log.Infof("Scale-in nodes...")
}

Expand Down

0 comments on commit 9f44afc

Please sign in to comment.