Skip to content

Commit

Permalink
Clean up profile folder after minikube delete
Browse files Browse the repository at this point in the history
  • Loading branch information
fenglixa authored and medyagh committed Jun 24, 2019
1 parent 62c0d53 commit 467d8c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions pkg/minikube/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 467d8c9

Please sign in to comment.