|
|
@ -21,6 +21,7 @@ cluster role bindings and CRDs`,
|
|
|
|
var (
|
|
|
|
var (
|
|
|
|
uninstallCRDs bool
|
|
|
|
uninstallCRDs bool
|
|
|
|
uninstallDryRun bool
|
|
|
|
uninstallDryRun bool
|
|
|
|
|
|
|
|
uninstallSilent bool
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
func init() {
|
|
|
@ -28,6 +29,8 @@ func init() {
|
|
|
|
"removes all CRDs previously installed")
|
|
|
|
"removes all CRDs previously installed")
|
|
|
|
uninstallCmd.Flags().BoolVarP(&uninstallDryRun, "dry-run", "", false,
|
|
|
|
uninstallCmd.Flags().BoolVarP(&uninstallDryRun, "dry-run", "", false,
|
|
|
|
"only print the object that would be deleted")
|
|
|
|
"only print the object that would be deleted")
|
|
|
|
|
|
|
|
uninstallCmd.Flags().BoolVarP(&uninstallSilent, "silent", "", false,
|
|
|
|
|
|
|
|
"delete components without asking for confirmation")
|
|
|
|
|
|
|
|
|
|
|
|
rootCmd.AddCommand(uninstallCmd)
|
|
|
|
rootCmd.AddCommand(uninstallCmd)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -39,7 +42,7 @@ func uninstallCmdRun(cmd *cobra.Command, args []string) error {
|
|
|
|
dryRun := ""
|
|
|
|
dryRun := ""
|
|
|
|
if uninstallDryRun {
|
|
|
|
if uninstallDryRun {
|
|
|
|
dryRun = "--dry-run=client"
|
|
|
|
dryRun = "--dry-run=client"
|
|
|
|
} else {
|
|
|
|
} else if !uninstallSilent {
|
|
|
|
prompt := promptui.Prompt{
|
|
|
|
prompt := promptui.Prompt{
|
|
|
|
Label: fmt.Sprintf("Are you sure you want to delete the %s namespace", namespace),
|
|
|
|
Label: fmt.Sprintf("Are you sure you want to delete the %s namespace", namespace),
|
|
|
|
IsConfirm: true,
|
|
|
|
IsConfirm: true,
|
|
|
|