From 9a89855997d2d53864d9f1e836d4c669fa5e486f Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Thu, 14 Oct 2021 16:01:59 -0700 Subject: [PATCH] add backwards compatible mount-process delete --- cmd/minikube/cmd/delete.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/cmd/minikube/cmd/delete.go b/cmd/minikube/cmd/delete.go index e000712547..67fcb756aa 100644 --- a/cmd/minikube/cmd/delete.go +++ b/cmd/minikube/cmd/delete.go @@ -518,7 +518,22 @@ func deleteMachineDirectories(cc *config.ClusterConfig) { // killMountProcess kills the mount process, if it is running func killMountProcess() error { profile := viper.GetString("profile") - pidPath := filepath.Join(localpath.Profile(profile), constants.MountProcessFileName) + paths := []string{ + localpath.MiniPath(), // legacy mount-process path for backwards compatibility + filepath.Join(localpath.Profile(profile)), + } + + for _, path := range paths { + if err := killProcess(path); err != nil { + return err + } + } + + return nil +} + +func killProcess(path string) error { + pidPath := filepath.Join(path, constants.MountProcessFileName) if _, err := os.Stat(pidPath); os.IsNotExist(err) { return nil }