Skip to content

Commit a522a2d

Browse files
authored
CLOUDP-58568: Deleting alert configs is not asking for confirmation (#36)
1 parent 9fb1cca commit a522a2d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

internal/cli/atlas_alert_config_delete.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,21 @@ func AtlasAlertConfigDeleteBuilder() *cobra.Command {
4646
opts := &atlasAlertConfigDeleteOpts{
4747
globalOpts: newGlobalOpts(),
4848
deleteOpts: &deleteOpts{
49-
successMessage: "Alert Config '%s' deleted\n",
50-
failMessage: "Alert Config not deleted",
49+
successMessage: "Alert config '%s' deleted\n",
50+
failMessage: "Alert config not deleted",
5151
},
5252
}
5353
cmd := &cobra.Command{
5454
Use: "delete [id]",
55-
Short: "Delete an Atlas Alert Config.",
55+
Short: "Delete an alert config.",
5656
Aliases: []string{"rm", "Delete", "Remove"},
5757
Args: cobra.ExactArgs(1),
5858
PreRunE: func(cmd *cobra.Command, args []string) error {
59+
if err := opts.init(); err != nil {
60+
return err
61+
}
5962
opts.entry = args[0]
60-
return opts.init()
63+
return opts.Confirm()
6164
},
6265
RunE: func(cmd *cobra.Command, args []string) error {
6366
return opts.Run()

0 commit comments

Comments
 (0)