vendor update for CSI 0.3.0

This commit is contained in:
gman
2018-07-18 16:47:22 +02:00
parent 6f484f92fc
commit 8ea659f0d5
6810 changed files with 438061 additions and 193861 deletions

View File

@ -9,7 +9,10 @@ go_library(
name = "go_default_library",
srcs = ["build.go"],
importpath = "k8s.io/kubernetes/test/e2e_node/builder",
deps = ["//vendor/github.com/golang/glog:go_default_library"],
deps = [
"//test/utils:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
],
)
filegroup(

View File

@ -22,10 +22,10 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"github.com/golang/glog"
"k8s.io/kubernetes/test/utils"
)
var k8sBinDir = flag.String("k8s-bin-dir", "", "Directory containing k8s kubelet binaries.")
@ -39,7 +39,7 @@ var buildTargets = []string{
func BuildGo() error {
glog.Infof("Building k8s binaries...")
k8sRoot, err := GetK8sRootDir()
k8sRoot, err := utils.GetK8sRootDir()
if err != nil {
return fmt.Errorf("failed to locate kubernetes root directory %v.", err)
}
@ -75,7 +75,7 @@ func getK8sBin(bin string) (string, error) {
return filepath.Join(path, bin), nil
}
buildOutputDir, err := GetK8sBuildOutputDir()
buildOutputDir, err := utils.GetK8sBuildOutputDir()
if err != nil {
return "", err
}
@ -84,53 +84,7 @@ func getK8sBin(bin string) (string, error) {
}
// Give up with error
return "", fmt.Errorf("Unable to locate %s. Can be defined using --k8s-path.", bin)
}
// GetK8sRootDir returns the root directory for kubernetes, if present in the gopath.
func GetK8sRootDir() (string, error) {
dir, err := RootDir()
if err != nil {
return "", err
}
return filepath.Join(dir, fmt.Sprintf("%s/", "k8s.io/kubernetes")), nil
}
// GetCAdvisorRootDir returns the root directory for cAdvisor, if present in the gopath.
func GetCAdvisorRootDir() (string, error) {
dir, err := RootDir()
if err != nil {
return "", err
}
return filepath.Join(dir, fmt.Sprintf("%s/", "github.com/google/cadvisor")), nil
}
// TODO: Dedup / merge this with comparable utilities in e2e/util.go
// RootDir returns the path to the directory containing the k8s.io directory
func RootDir() (string, error) {
// Get the directory of the current executable
_, testExec, _, _ := runtime.Caller(0)
path := filepath.Dir(testExec)
// Look for the kubernetes source root directory
if strings.Contains(path, "k8s.io/kubernetes") {
splitPath := strings.Split(path, "k8s.io/kubernetes")
return splitPath[0], nil
}
return "", fmt.Errorf("Could not find kubernetes source root directory.")
}
func GetK8sBuildOutputDir() (string, error) {
k8sRoot, err := GetK8sRootDir()
if err != nil {
return "", err
}
buildOutputDir := filepath.Join(k8sRoot, "_output/local/go/bin")
if _, err := os.Stat(buildOutputDir); err != nil {
return "", err
}
return buildOutputDir, nil
return "", fmt.Errorf("unable to locate %s, Can be defined using --k8s-path", bin)
}
func GetKubeletServerBin() string {