File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,11 +2,13 @@ package cmd
22
33import (
44 "fmt"
5+ "path/filepath"
6+
57 opConfig "github.com/onepanelio/cli/config"
68 "github.com/onepanelio/cli/files"
79 "github.com/onepanelio/cli/util"
810 "github.com/spf13/cobra"
9- "path/filepath "
11+ "k8s.io/client-go/tools/clientcmd "
1012)
1113
1214var (
@@ -21,7 +23,15 @@ var deleteCmd = &cobra.Command{
2123 Example : "delete" ,
2224 Run : func (cmd * cobra.Command , args []string ) {
2325 if skipConfirmDelete == false {
24- fmt .Print ("Are you sure you want to delete onepanel? ('y' or 'yes' to confirm. Anything else to cancel): " )
26+ options := clientcmd .NewDefaultPathOptions ()
27+ config , err := options .GetStartingConfig ()
28+ if err != nil {
29+ fmt .Printf ("Unable to get kubernetes config: %v" , err .Error ())
30+ return
31+ }
32+
33+ fmt .Println ("The current kubernetes context is:" , config .CurrentContext )
34+ fmt .Printf ("Are you sure you want to delete onepanel from '%s'? ('y' or 'yes' to confirm. Anything else to cancel): " , config .CurrentContext )
2535 userInput := ""
2636 if _ , err := fmt .Scanln (& userInput ); err != nil {
2737 fmt .Printf ("Unable to get response\n " )
You can’t perform that action at this time.
0 commit comments