diff --git a/cmd/minikube/cmd/delete.go b/cmd/minikube/cmd/delete.go index 096886842316..3e6a442d3d50 100644 --- a/cmd/minikube/cmd/delete.go +++ b/cmd/minikube/cmd/delete.go @@ -83,7 +83,7 @@ associated files.`, console.Fatal("Failed to kill mount process: %v", err) } - if err := os.Remove(constants.GetProfileFile(viper.GetString(pkg_config.MachineProfile))); err != nil { + if err := os.RemoveAll(constants.GetProfilePath(viper.GetString(pkg_config.MachineProfile))); err != nil { if os.IsNotExist(err) { console.OutStyle(console.Meh, "%q profile does not exist", profile) os.Exit(0) diff --git a/pkg/minikube/constants/constants.go b/pkg/minikube/constants/constants.go index 183712d7e9ec..6690a0bf7919 100644 --- a/pkg/minikube/constants/constants.go +++ b/pkg/minikube/constants/constants.go @@ -181,6 +181,11 @@ func GetProfileFile(profile string) string { return filepath.Join(GetMinipath(), "profiles", profile, "config.json") } +// GetProfilePath returns the Minikube profile path of config file +func GetProfilePath(profile string) string { + return filepath.Join(GetMinipath(), "profiles", profile) +} + // AddonsPath is the default path of the addons configuration const AddonsPath = "/etc/kubernetes/addons"