From ebf3017d260d733c5bdac2139f28f266607897ca Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Fri, 14 Oct 2022 08:14:27 +1300 Subject: [PATCH] return error if delete fails --- minikube/service/minikube_node.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/minikube/service/minikube_node.go b/minikube/service/minikube_node.go index 8067d86..7bfcef4 100644 --- a/minikube/service/minikube_node.go +++ b/minikube/service/minikube_node.go @@ -63,16 +63,22 @@ func (m *MinikubeNode) Add(cc *config.ClusterConfig, starter node.Starter) error func (m *MinikubeNode) Delete(cc config.ClusterConfig, name string) (*config.Node, error) { node, err := node.Delete(cc, name) + if err != nil { + return node, err + } + machineDir := filepath.Join(localpath.MiniPath(), "machines", name) profilesDir := filepath.Join(localpath.MiniPath(), "profiles", name) err = rmdir(machineDir) if err != nil { return node, err } + err = rmdir(profilesDir) if err != nil { return node, err } + return node, err }