func runPrecheck(cluster *ecsv1.KubernetesCluster) (bool, string) {
	results := make([]chan types.PrecheckResult, len(cluster.Spec.Cluster.NodeList))
	finished := make(chan bool)
	ctx, cacnel := context.WithTimeout(context.Background(), precheckTimeout)
	defer cacnel()
	precheckCli := precheck.New(&precheck.Options{
		Timeout: sshServerTimeout,
	})
	go precheckCli.HostEnv(cluster, results, finished)
	checkResult := true
	checkMsg := ""
	select {
	case <-ctx.Done():
		msg := fmt.Sprintf("[precheck] %s timeout", cluster.Name)
		checkResult = false
		checkMsg = msg
	case <-finished:
		for _, result := range results {
			res := <-result
			if !res.Success {
				checkResult = false
				checkMsg += fmt.Sprintf("%v : %v\n", res.Host, res.Result)
			}
		}
	}
	return checkResult, checkMsg
}
runPrecheck is range all node list and exec check script
package controller
import (
	"context"
	"fmt"
	"time"
	ecsv1 "github.com/gosoon/kubernetes-operator/pkg/apis/ecs/v1"
	"github.com/gosoon/kubernetes-operator/pkg/enum"
	"github.com/gosoon/kubernetes-operator/pkg/precheck"
	"github.com/gosoon/kubernetes-operator/pkg/types"
	"github.com/gosoon/glog"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
	precheckTimeout  time.Duration = 35 * time.Second
	sshServerTimeout time.Duration = 30 * time.Second
)
func (c *Controller) processClusterPrecheck(cluster *ecsv1.KubernetesCluster) error {
	success, msg := runPrecheck(cluster)
	if success {
		switch cluster.Annotations[enum.Operation] {
		case enum.KubeCreating:
			return c.processClusterNew(cluster)
		case enum.KubeScalingUp:
			return c.processClusterScaleUp(cluster)
		case enum.KubeScalingDown:
			return c.processClusterScaleDown(cluster)
		}
	}
	curCluster := cluster.DeepCopy()
	namespace := curCluster.Namespace
	curCluster.Status.Phase = enum.Failed
	curCluster.Status.Reason = fmt.Sprintf("[precheck] failed with:\n %v", msg)
	curCluster.Status.LastTransitionTime = metav1.Now()
	curCluster, err := c.kubernetesClusterClientset.EcsV1().KubernetesClusters(namespace).UpdateStatus(curCluster)
	if err != nil {
		glog.Errorf("update status to [Failed] failed with:%v", err)
	}
	return err
}