Merge pull request #153 from anfernee/master

Fix build for multiple GOPATHs
This commit is contained in:
Lantao Liu 2017-09-01 17:05:35 -07:00 committed by GitHub
commit 911a90ce01
3 changed files with 17 additions and 0 deletions

View File

@ -36,6 +36,15 @@ CNI_DIR=/opt/cni
CNI_CONFIG_DIR=/etc/cni/net.d CNI_CONFIG_DIR=/etc/cni/net.d
CONTAINERD_PKG=github.com/containerd/containerd CONTAINERD_PKG=github.com/containerd/containerd
# Check GOPATH
if [[ -z "${GOPATH}" ]]; then
echo "GOPATH is not set"
exit 1
fi
# For multiple GOPATHs, keep the first one only
GOPATH=${GOPATH%%:*}
# Install runc # Install runc
go get -d ${RUNC_PKG}/... go get -d ${RUNC_PKG}/...
cd ${GOPATH}/src/${RUNC_PKG} cd ${GOPATH}/src/${RUNC_PKG}

View File

@ -24,11 +24,15 @@ FOCUS=${FOCUS:-}
SKIP=${SKIP:-""} SKIP=${SKIP:-""}
REPORT_DIR=${REPORT_DIR:-"/tmp/test-cri"} REPORT_DIR=${REPORT_DIR:-"/tmp/test-cri"}
# Check GOPATH
if [[ -z "${GOPATH}" ]]; then if [[ -z "${GOPATH}" ]]; then
echo "GOPATH is not set" echo "GOPATH is not set"
exit 1 exit 1
fi fi
# For multiple GOPATHs, keep the first one only
GOPATH=${GOPATH%%:*}
CRITEST=${GOPATH}/bin/critest CRITEST=${GOPATH}/bin/critest
CRITEST_PKG=github.com/kubernetes-incubator/cri-tools CRITEST_PKG=github.com/kubernetes-incubator/cri-tools
CRICONTAINERD_SOCK=/var/run/cri-containerd.sock CRICONTAINERD_SOCK=/var/run/cri-containerd.sock

View File

@ -28,6 +28,7 @@ export FOCUS=${FOCUS:-""}
export SKIP=${SKIP:-${DEFAULT_SKIP}} export SKIP=${SKIP:-${DEFAULT_SKIP}}
REPORT_DIR=${REPORT_DIR:-"/tmp/test-e2e-node"} REPORT_DIR=${REPORT_DIR:-"/tmp/test-e2e-node"}
# Check GOPATH
if [[ -z "${GOPATH}" ]]; then if [[ -z "${GOPATH}" ]]; then
echo "GOPATH is not set" echo "GOPATH is not set"
exit 1 exit 1
@ -49,6 +50,9 @@ if sudo iptables -L FORWARD | grep "Chain FORWARD (policy DROP)" > /dev/null; th
sudo iptables -A FORWARD -w -p ICMP -j ACCEPT sudo iptables -A FORWARD -w -p ICMP -j ACCEPT
fi fi
# For multiple GOPATHs, keep the first one only
GOPATH=${GOPATH%%:*}
# Get kubernetes # Get kubernetes
KUBERNETES_REPO="https://github.com/kubernetes/kubernetes" KUBERNETES_REPO="https://github.com/kubernetes/kubernetes"
KUBERNETES_PATH="${GOPATH}/src/k8s.io/kubernetes" KUBERNETES_PATH="${GOPATH}/src/k8s.io/kubernetes"