Skip to content

Commit

Permalink
fix minikube stop output
Browse files Browse the repository at this point in the history
  • Loading branch information
sharifelgamal committed May 6, 2020
1 parent 4607c0f commit 5ed946c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmd/minikube/cmd/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/golang/glog"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/kubeconfig"
Expand All @@ -51,10 +50,11 @@ func runStop(cmd *cobra.Command, args []string) {
defer api.Close()

for _, n := range cc.Nodes {
nonexistent := stop(api, *cc, n)
machineName := driver.MachineName(*cc, n)
nonexistent := stop(api, machineName)

if !nonexistent {
out.T(out.Stopped, `Node "{{.node_name}}" stopped.`, out.V{"node_name": n.Name})
out.T(out.Stopped, `Node "{{.node_name}}" stopped.`, out.V{"node_name": machineName})
}
}

Expand All @@ -67,9 +67,8 @@ func runStop(cmd *cobra.Command, args []string) {
}
}

func stop(api libmachine.API, cluster config.ClusterConfig, n config.Node) bool {
func stop(api libmachine.API, machineName string) bool {
nonexistent := false
machineName := driver.MachineName(cluster, n)

tryStop := func() (err error) {
err = machine.StopHost(api, machineName)
Expand Down

0 comments on commit 5ed946c

Please sign in to comment.