Skip to content

Commit 80c3324

Browse files
Merge pull request #8023 from sharifelgamal/node-stop
Fix missing node name in minikube stop output
2 parents 4607c0f + 5ed946c commit 80c3324

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cmd/minikube/cmd/stop.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"github.com/golang/glog"
2525
"github.com/pkg/errors"
2626
"github.com/spf13/cobra"
27-
"k8s.io/minikube/pkg/minikube/config"
2827
"k8s.io/minikube/pkg/minikube/driver"
2928
"k8s.io/minikube/pkg/minikube/exit"
3029
"k8s.io/minikube/pkg/minikube/kubeconfig"
@@ -51,10 +50,11 @@ func runStop(cmd *cobra.Command, args []string) {
5150
defer api.Close()
5251

5352
for _, n := range cc.Nodes {
54-
nonexistent := stop(api, *cc, n)
53+
machineName := driver.MachineName(*cc, n)
54+
nonexistent := stop(api, machineName)
5555

5656
if !nonexistent {
57-
out.T(out.Stopped, `Node "{{.node_name}}" stopped.`, out.V{"node_name": n.Name})
57+
out.T(out.Stopped, `Node "{{.node_name}}" stopped.`, out.V{"node_name": machineName})
5858
}
5959
}
6060

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

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

7473
tryStop := func() (err error) {
7574
err = machine.StopHost(api, machineName)

0 commit comments

Comments
 (0)