Skip to content

Commit 0e157cb

Browse files
authored
Merge pull request kubernetes#75713 from SataQiu/fix-e2e_node-builder-20190326
Fix golint failures in test/e2e_node/builder
2 parents 0a59758 + b1cb58f commit 0e157cb

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

hack/.golint_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,6 @@ test/e2e/storage/utils
654654
test/e2e/storage/vsphere
655655
test/e2e_kubeadm
656656
test/e2e_node
657-
test/e2e_node/builder
658657
test/e2e_node/remote
659658
test/e2e_node/runner/remote
660659
test/e2e_node/services

test/e2e_node/builder/build.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,20 @@ var buildTargets = []string{
3737
"cluster/gce/gci/mounter",
3838
}
3939

40+
// BuildGo builds k8s binaries.
4041
func BuildGo() error {
4142
klog.Infof("Building k8s binaries...")
4243
k8sRoot, err := utils.GetK8sRootDir()
4344
if err != nil {
44-
return fmt.Errorf("failed to locate kubernetes root directory %v.", err)
45+
return fmt.Errorf("failed to locate kubernetes root directory %v", err)
4546
}
4647
targets := strings.Join(buildTargets, " ")
4748
cmd := exec.Command("make", "-C", k8sRoot, fmt.Sprintf("WHAT=%s", targets))
4849
cmd.Stdout = os.Stdout
4950
cmd.Stderr = os.Stderr
5051
err = cmd.Run()
5152
if err != nil {
52-
return fmt.Errorf("failed to build go packages %v\n", err)
53+
return fmt.Errorf("failed to build go packages %v", err)
5354
}
5455
return nil
5556
}
@@ -62,14 +63,14 @@ func getK8sBin(bin string) (string, error) {
6263
return "", err
6364
}
6465
if _, err := os.Stat(filepath.Join(*k8sBinDir, bin)); err != nil {
65-
return "", fmt.Errorf("Could not find %s under directory %s.", bin, absPath)
66+
return "", fmt.Errorf("Could not find %s under directory %s", bin, absPath)
6667
}
6768
return filepath.Join(absPath, bin), nil
6869
}
6970

7071
path, err := filepath.Abs(filepath.Dir(os.Args[0]))
7172
if err != nil {
72-
return "", fmt.Errorf("Could not find absolute path of directory containing the tests %s.", filepath.Dir(os.Args[0]))
73+
return "", fmt.Errorf("Could not find absolute path of directory containing the tests %s", filepath.Dir(os.Args[0]))
7374
}
7475
if _, err := os.Stat(filepath.Join(path, bin)); err == nil {
7576
return filepath.Join(path, bin), nil
@@ -87,6 +88,7 @@ func getK8sBin(bin string) (string, error) {
8788
return "", fmt.Errorf("unable to locate %s, Can be defined using --k8s-path", bin)
8889
}
8990

91+
// GetKubeletServerBin returns the path of kubelet binary.
9092
func GetKubeletServerBin() string {
9193
bin, err := getK8sBin("kubelet")
9294
if err != nil {

0 commit comments

Comments
 (0)