Unset profile when it is deleted

pull/4946/head
josedonizetti 2019-07-30 12:44:50 -03:00 committed by Medya Gh
parent 043ebfe397
commit 9eabb0a8f3
3 changed files with 8 additions and 3 deletions

View File

@ -30,7 +30,7 @@ var configUnsetCmd = &cobra.Command{
if len(args) != 1 {
exit.UsageT("usage: minikube config unset PROPERTY_NAME")
}
err := unset(args[0])
err := Unset(args[0])
if err != nil {
exit.WithError("unset failed", err)
}
@ -41,7 +41,8 @@ func init() {
ConfigCmd.AddCommand(configUnsetCmd)
}
func unset(name string) error {
// Unset unsets a property
func Unset(name string) error {
m, err := pkgConfig.ReadConfig()
if err != nil {
return err

View File

@ -25,7 +25,7 @@ func TestUnsetConfig(t *testing.T) {
if err != nil {
t.Errorf("Failed to set the property %q", propName)
}
err = unset(propName)
err = Unset(propName)
if err != nil {
t.Errorf("Failed to unset property %q", err)
}

View File

@ -92,6 +92,10 @@ func runDelete(cmd *cobra.Command, args []string) {
if err := pkgutil.DeleteKubeConfigContext(constants.KubeconfigPath, machineName); err != nil {
exit.WithError("update config", err)
}
if err := cmdcfg.Unset(pkg_config.MachineProfile); err != nil {
exit.WithError("unset minikube profile", err)
}
}
func uninstallKubernetes(api libmachine.API, kc pkg_config.KubernetesConfig, bsName string) {