@@ -47,7 +47,7 @@ associated files.`,
47
47
// runDelete handles the executes the flow of "minikube delete"
48
48
func runDelete (cmd * cobra.Command , args []string ) {
49
49
if len (args ) > 0 {
50
- exit .Usage ("usage: minikube delete" )
50
+ exit .UsageT ("usage: minikube delete" )
51
51
}
52
52
profile := viper .GetString (pkg_config .MachineProfile )
53
53
api , err := machine .NewAPIClient ()
@@ -58,7 +58,7 @@ func runDelete(cmd *cobra.Command, args []string) {
58
58
59
59
cc , err := pkg_config .Load ()
60
60
if err != nil && ! os .IsNotExist (err ) {
61
- console .ErrLn ( "Error loading profile config: %v " , err )
61
+ console .ErrT ( console . Sad , "Error loading profile config: {{.error}} " , console. Arg { "name" : profile } )
62
62
}
63
63
64
64
// In the case of "none", we want to uninstall Kubernetes as there is no VM to delete
@@ -76,17 +76,17 @@ func runDelete(cmd *cobra.Command, args []string) {
76
76
}
77
77
78
78
if err := cmdUtil .KillMountProcess (); err != nil {
79
- console .Fatal ("Failed to kill mount process: %v " , err )
79
+ console .FatalT ("Failed to kill mount process: {{.error}} " , console. Arg { "error" : err } )
80
80
}
81
81
82
82
if err := os .RemoveAll (constants .GetProfilePath (viper .GetString (pkg_config .MachineProfile ))); err != nil {
83
83
if os .IsNotExist (err ) {
84
- console .OutStyle (console .Meh , "%q profile does not exist" , profile )
84
+ console .OutT (console .Meh , `"{{.profile_name}}" profile does not exist` , console. Arg { "profile_name" : profile } )
85
85
os .Exit (0 )
86
86
}
87
87
exit .WithError ("Failed to remove profile" , err )
88
88
}
89
- console .OutStyle (console .Crushed , " The %q cluster has been deleted." , profile )
89
+ console .OutT (console .Crushed , ` The "{{.cluster_name}}" cluster has been deleted.` , console. Arg { "cluster_name" : profile } )
90
90
91
91
machineName := pkg_config .GetMachineName ()
92
92
if err := pkgutil .DeleteKubeConfigContext (constants .KubeconfigPath , machineName ); err != nil {
@@ -95,12 +95,12 @@ func runDelete(cmd *cobra.Command, args []string) {
95
95
}
96
96
97
97
func uninstallKubernetes (api libmachine.API , kc pkg_config.KubernetesConfig , bsName string ) {
98
- console .OutStyle (console .Resetting , "Uninstalling Kubernetes %s using %s ..." , kc .KubernetesVersion , bsName )
98
+ console .OutT (console .Resetting , "Uninstalling Kubernetes {{.kubernetes_version}} using {{.bootstrapper_name}} ..." , console. Arg { "kubernetes_version" : kc .KubernetesVersion , "bootstrapper_name" : bsName } )
99
99
clusterBootstrapper , err := getClusterBootstrapper (api , bsName )
100
100
if err != nil {
101
- console .ErrLn ( "Unable to get bootstrapper: %v " , err )
101
+ console .ErrT ( console . Empty , "Unable to get bootstrapper: {{.error}} " , console. Arg { "error" : err } )
102
102
} else if err = clusterBootstrapper .DeleteCluster (kc ); err != nil {
103
- console .ErrLn ( "Failed to delete cluster: %v " , err )
103
+ console .ErrT ( console . Empty , "Failed to delete cluster: {{.error}} " , console. Arg { "error" : err } )
104
104
}
105
105
}
106
106
0 commit comments