Add bazel-test-integration for Arm64

Signed-off-by: Bin Lu <bin.lu@arm.com>
This commit is contained in:
Bin Lu
2019-03-01 17:25:04 +08:00
parent e9b285afbb
commit 973a3c7233
4 changed files with 40 additions and 15 deletions

View File

@@ -4,6 +4,7 @@ load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
load("//build:platforms.bzl", "go_platform_constraint")
go_library(
name = "go_default_library",
@@ -15,9 +16,23 @@ go_library(
"test_server.go",
"util.go",
],
data = [
"@com_coreos_etcd//:etcd",
],
data = select({
go_platform_constraint(
arch = "arm64",
os = "linux",
): [
"@com_coreos_etcd_arm64//:etcd",
],
go_platform_constraint(
arch = "ppc64le",
os = "linux",
): [
"@com_coreos_etcd_ppc64le//:etcd",
],
"//conditions:default": [
"@com_coreos_etcd_amd64//:etcd",
],
}),
importpath = "k8s.io/kubernetes/test/integration/framework",
deps = [
"//cmd/kube-apiserver/app:go_default_library",

View File

@@ -24,6 +24,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"k8s.io/klog"
@@ -43,7 +44,8 @@ You can use 'hack/install-etcd.sh' to install a copy in third_party/.
// getEtcdPath returns a path to an etcd executable.
func getEtcdPath() (string, error) {
bazelPath := filepath.Join(os.Getenv("RUNFILES_DIR"), "com_coreos_etcd/etcd")
bazelPath := filepath.Join(os.Getenv("RUNFILES_DIR"), fmt.Sprintf("com_coreos_etcd_%s", runtime.GOARCH), "etcd")
p, err := exec.LookPath(bazelPath)
if err == nil {
return p, nil