Skip to content

Commit

Permalink
add significant warning destroying a cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis committed Jan 12, 2022
1 parent 467736d commit 21b2509
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pkg/cluster/manager/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@ func (m *Manager) DestroyCluster(name string, gOpt operator.Options, destroyOpt
}

if !skipConfirm {
if err := tui.PromptForConfirmOrAbortError(
"This operation will destroy %s %s cluster %s and its data.\nDo you want to continue? [y/N]:",
m.sysName,
color.HiYellowString(base.Version),
color.HiYellowString(name)); err != nil {
m.logger.Warnf(color.HiRedString(tui.ASCIIArtWarning))
if err := tui.PromptForAnswerOrAbortError(
"Yes, I know my cluster and data will be deleted.",
fmt.Sprintf("This operation will destroy %s %s cluster %s and its data.",
m.sysName,
color.HiYellowString(base.Version),
color.HiYellowString(name),
)+"\nAre you sure to continue?",
); err != nil {
return err
}
m.logger.Infof("Destroying cluster...")
Expand Down

0 comments on commit 21b2509

Please sign in to comment.