Fix uninitalized variable

pull/7176/head
Thomas Stromberg 2020-03-23 13:16:37 -07:00
parent 5bf84cc282
commit 77f97a58f4
2 changed files with 8 additions and 1 deletions

View File

@ -103,9 +103,13 @@ var statusCmd = &cobra.Command{
api, cc := mustload.Partial(cname)
var st *Status
var err error
for _, n := range cc.Nodes {
glog.Infof("checking status of %s ...", n.Name)
machineName := driver.MachineName(*cc, n)
st, err := status(api, machineName, n.ControlPlane)
st, err = status(api, machineName, n.ControlPlane)
glog.Infof("%s status: %+v", machineName, st)
if err != nil {
glog.Errorf("status error: %v", err)
}
@ -127,6 +131,7 @@ var statusCmd = &cobra.Command{
}
}
// TODO: Update for multi-node
os.Exit(exitCode(st))
},
}

View File

@ -25,6 +25,7 @@ import (
"github.com/docker/machine/libmachine"
"github.com/docker/machine/libmachine/host"
"github.com/docker/machine/libmachine/state"
"github.com/golang/glog"
"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/bootstrapper/bsutil/kverify"
"k8s.io/minikube/pkg/minikube/command"
@ -47,6 +48,7 @@ type ClusterController struct {
// Partial is a cmd-friendly way to load a cluster which may or may not be running
func Partial(name string) (libmachine.API, *config.ClusterConfig) {
glog.Infof("Loading cluster: %s", name)
api, err := machine.NewAPIClient()
if err != nil {
exit.WithError("libmachine failed", err)