diff --git a/cmd/minikube/cmd/delete.go b/cmd/minikube/cmd/delete.go index 267435a05dd1..96438d2be480 100644 --- a/cmd/minikube/cmd/delete.go +++ b/cmd/minikube/cmd/delete.go @@ -23,11 +23,12 @@ import ( "path/filepath" "strconv" - "github.com/docker/machine/libmachine" "github.com/docker/machine/libmachine/mcnerror" "github.com/golang/glog" ps "github.com/mitchellh/go-ps" "github.com/pkg/errors" + + "github.com/docker/machine/libmachine" "github.com/spf13/cobra" "github.com/spf13/viper" cmdcfg "k8s.io/minikube/cmd/minikube/cmd/config" @@ -78,7 +79,7 @@ func runDelete(cmd *cobra.Command, args []string) { if err = cluster.DeleteHost(api); err != nil { switch errors.Cause(err).(type) { case mcnerror.ErrHostDoesNotExist: - out.T(out.Meh, `"{{.name}}" cluster does not exist`, out.V{"name": profile}) + out.T(out.Meh, `"{{.name}}" cluster does not exist. Proceeding ahead with cleanup.`, out.V{"name": profile}) default: out.T(out.FailureType, "Failed to delete cluster: {{.error}}", out.V{"error": err}) out.T(out.Notice, `You may need to manually remove the "{{.name}}" VM from your hypervisor`, out.V{"name": profile}) diff --git a/pkg/minikube/cluster/cluster.go b/pkg/minikube/cluster/cluster.go index 04d0ec29566a..39c34342d144 100644 --- a/pkg/minikube/cluster/cluster.go +++ b/pkg/minikube/cluster/cluster.go @@ -280,6 +280,16 @@ func DeleteHost(api libmachine.API) error { if err != nil { return errors.Wrap(err, "load") } + + // Get the status of the host. Ensure that it exists before proceeding ahead. + status, err := GetHostStatus(api) + if err != nil { + exit.WithCodeT(exit.Failure, "Unable to get the status of the cluster.") + } + if status == state.None.String() { + return mcnerror.ErrHostDoesNotExist{Name: host.Name} + } + // This is slow if SSH is not responding, but HyperV hangs otherwise, See issue #2914 if host.Driver.DriverName() == constants.DriverHyperv { if err := trySSHPowerOff(host); err != nil { diff --git a/site/content/en/docs/Contributing/building.en.md b/site/content/en/docs/Contributing/building.en.md index ff3f7bb1b9aa..f13a5472b919 100644 --- a/site/content/en/docs/Contributing/building.en.md +++ b/site/content/en/docs/Contributing/building.en.md @@ -32,6 +32,11 @@ make Note: On Windows, this will only work in Git Bash or other terminals that support bash commands. +You can also build platform specific executables like below: + 1. `make windows` will build the binary for Windows platform + 2. `make linux` will build the binary for Linux platform + 3. `make darwin` will build the binary for Darwin/Mac platform + ## Compiling minikube using Docker To cross-compile to/from different operating systems: