diff --git a/hack/.golint_failures b/hack/.golint_failures index d65f45fec6..8d4eb00840 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -654,7 +654,6 @@ test/e2e/storage/utils test/e2e/storage/vsphere test/e2e_kubeadm test/e2e_node -test/e2e_node/builder test/e2e_node/remote test/e2e_node/runner/remote test/e2e_node/services diff --git a/test/e2e_node/builder/build.go b/test/e2e_node/builder/build.go index 797de1dc53..455bd0c818 100644 --- a/test/e2e_node/builder/build.go +++ b/test/e2e_node/builder/build.go @@ -37,11 +37,12 @@ var buildTargets = []string{ "cluster/gce/gci/mounter", } +// BuildGo builds k8s binaries. func BuildGo() error { klog.Infof("Building k8s binaries...") k8sRoot, err := utils.GetK8sRootDir() if err != nil { - return fmt.Errorf("failed to locate kubernetes root directory %v.", err) + return fmt.Errorf("failed to locate kubernetes root directory %v", err) } targets := strings.Join(buildTargets, " ") cmd := exec.Command("make", "-C", k8sRoot, fmt.Sprintf("WHAT=%s", targets)) @@ -49,7 +50,7 @@ func BuildGo() error { cmd.Stderr = os.Stderr err = cmd.Run() if err != nil { - return fmt.Errorf("failed to build go packages %v\n", err) + return fmt.Errorf("failed to build go packages %v", err) } return nil } @@ -62,14 +63,14 @@ func getK8sBin(bin string) (string, error) { return "", err } if _, err := os.Stat(filepath.Join(*k8sBinDir, bin)); err != nil { - return "", fmt.Errorf("Could not find %s under directory %s.", bin, absPath) + return "", fmt.Errorf("Could not find %s under directory %s", bin, absPath) } return filepath.Join(absPath, bin), nil } path, err := filepath.Abs(filepath.Dir(os.Args[0])) if err != nil { - return "", fmt.Errorf("Could not find absolute path of directory containing the tests %s.", filepath.Dir(os.Args[0])) + return "", fmt.Errorf("Could not find absolute path of directory containing the tests %s", filepath.Dir(os.Args[0])) } if _, err := os.Stat(filepath.Join(path, bin)); err == nil { return filepath.Join(path, bin), nil @@ -87,6 +88,7 @@ func getK8sBin(bin string) (string, error) { return "", fmt.Errorf("unable to locate %s, Can be defined using --k8s-path", bin) } +// GetKubeletServerBin returns the path of kubelet binary. func GetKubeletServerBin() string { bin, err := getK8sBin("kubelet") if err != nil {