Skip to content

Commit

Permalink
Adjusts message so external DB warning prints either way
Browse files Browse the repository at this point in the history
  • Loading branch information
cbron committed Dec 18, 2024
1 parent e25542c commit 5933283
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/cli/destroy/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,14 @@ func deleteAllResourcesAndWait(ctxWithoutDeadline, ctxWithDeadLine context.Conte
if err != nil {
return false, fmt.Errorf("failed to unmarshal virtual cluster config for %v %q: %w", resource, namespacedName, err)
}
if !nonInteractive {
if vConfig.ControlPlane.BackingStore.Database.External.Enabled && vConfig.ControlPlane.BackingStore.Database.External.Connector != "" {
if vConfig.ControlPlane.BackingStore.Database.External.Connector != "" {
log.Warnf("IMPORTANT! You are removing an externally deployed virtual cluster %q from the platform.\n It will not be destroyed as the deployment is managed externally, but its database will be removed rendering it inoperable.", namespacedName)
if !nonInteractive {
yesOpt := "yes"
noOpt := "no"
out, err := log.Question(&survey.QuestionOptions{
Options: []string{yesOpt, noOpt},
Question: fmt.Sprintf("IMPORTANT! You are removing an externally deployed virtual cluster %q from the platform.\n It will not be destroyed as the deployment is managed externally, but its connection to its database will be removed.\nDo you want to continue?", namespacedName),
Question: "Do you want to continue?",
})
if err != nil {
return false, fmt.Errorf("failed to prompt for confirmation: %w", err)
Expand Down

0 comments on commit 5933283

Please sign in to comment.