mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
Remove separate function for yesFlag in terminate
This commit is contained in:
parent
891b920685
commit
8d097424a1
@ -45,12 +45,12 @@ func runTerminate(cmd *cobra.Command, args []string) error {
|
||||
|
||||
func terminate(cmd *cobra.Command, terminator cloudTerminator, fileHandler file.Handler, spinner spinnerInterf,
|
||||
) error {
|
||||
flags, err := parseTerminateFlags(cmd)
|
||||
yesFlag, err := cmd.Flags().GetBool("yes")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !flags.yes {
|
||||
if !yesFlag {
|
||||
cmd.Println("You are about to terminate a Constellation cluster.")
|
||||
cmd.Println("All of its associated resources will be DESTROYED.")
|
||||
cmd.Println("This includes any other Terraform workspace in the current directory.")
|
||||
@ -85,18 +85,3 @@ func terminate(cmd *cobra.Command, terminator cloudTerminator, fileHandler file.
|
||||
|
||||
return retErr
|
||||
}
|
||||
|
||||
type terminateFlags struct {
|
||||
yes bool
|
||||
}
|
||||
|
||||
func parseTerminateFlags(cmd *cobra.Command) (terminateFlags, error) {
|
||||
yes, err := cmd.Flags().GetBool("yes")
|
||||
if err != nil {
|
||||
return terminateFlags{}, err
|
||||
}
|
||||
|
||||
return terminateFlags{
|
||||
yes: yes,
|
||||
}, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user