@@ -37,19 +37,20 @@ var buildTargets = []string{
37
37
"cluster/gce/gci/mounter" ,
38
38
}
39
39
40
+ // BuildGo builds k8s binaries.
40
41
func BuildGo () error {
41
42
klog .Infof ("Building k8s binaries..." )
42
43
k8sRoot , err := utils .GetK8sRootDir ()
43
44
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 )
45
46
}
46
47
targets := strings .Join (buildTargets , " " )
47
48
cmd := exec .Command ("make" , "-C" , k8sRoot , fmt .Sprintf ("WHAT=%s" , targets ))
48
49
cmd .Stdout = os .Stdout
49
50
cmd .Stderr = os .Stderr
50
51
err = cmd .Run ()
51
52
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 )
53
54
}
54
55
return nil
55
56
}
@@ -62,14 +63,14 @@ func getK8sBin(bin string) (string, error) {
62
63
return "" , err
63
64
}
64
65
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 )
66
67
}
67
68
return filepath .Join (absPath , bin ), nil
68
69
}
69
70
70
71
path , err := filepath .Abs (filepath .Dir (os .Args [0 ]))
71
72
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 ]))
73
74
}
74
75
if _ , err := os .Stat (filepath .Join (path , bin )); err == nil {
75
76
return filepath .Join (path , bin ), nil
@@ -87,6 +88,7 @@ func getK8sBin(bin string) (string, error) {
87
88
return "" , fmt .Errorf ("unable to locate %s, Can be defined using --k8s-path" , bin )
88
89
}
89
90
91
+ // GetKubeletServerBin returns the path of kubelet binary.
90
92
func GetKubeletServerBin () string {
91
93
bin , err := getK8sBin ("kubelet" )
92
94
if err != nil {
0 commit comments