From b11190c64e1eece6340811931dc410f155cf3122 Mon Sep 17 00:00:00 2001 From: Daehyeok Mun Date: Sun, 13 Dec 2020 21:54:47 -0800 Subject: [PATCH] Delete subnode's machine directories --- cmd/minikube/cmd/delete.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/minikube/cmd/delete.go b/cmd/minikube/cmd/delete.go index 8ce08f8d8582..7bfe9bfda21e 100644 --- a/cmd/minikube/cmd/delete.go +++ b/cmd/minikube/cmd/delete.go @@ -329,6 +329,7 @@ func deleteProfile(profile *config.Profile) error { // In case DeleteHost didn't complete the job. deleteProfileDirectory(profile.Name) + deleteMachineDirectories(cc) if err := deleteConfig(profile.Name); err != nil { return err @@ -496,6 +497,15 @@ func deleteProfileDirectory(profile string) { } } +func deleteMachineDirectories(cc *config.ClusterConfig) { + if cc != nil { + for _, n := range cc.Nodes { + machineName := driver.MachineName(*cc, n) + deleteProfileDirectory(machineName) + } + } +} + // killMountProcess kills the mount process, if it is running func killMountProcess() error { pidPath := filepath.Join(localpath.MiniPath(), constants.MountProcessFileName)