diff --git a/hack/install-deps.sh b/hack/install-deps.sh index 9bd643a20..85ae1c3ee 100755 --- a/hack/install-deps.sh +++ b/hack/install-deps.sh @@ -36,6 +36,15 @@ CNI_DIR=/opt/cni CNI_CONFIG_DIR=/etc/cni/net.d 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 go get -d ${RUNC_PKG}/... cd ${GOPATH}/src/${RUNC_PKG} diff --git a/hack/test-cri.sh b/hack/test-cri.sh index c9b61067b..387b03cc8 100755 --- a/hack/test-cri.sh +++ b/hack/test-cri.sh @@ -24,11 +24,15 @@ FOCUS=${FOCUS:-} SKIP=${SKIP:-""} REPORT_DIR=${REPORT_DIR:-"/tmp/test-cri"} +# Check GOPATH if [[ -z "${GOPATH}" ]]; then echo "GOPATH is not set" exit 1 fi +# For multiple GOPATHs, keep the first one only +GOPATH=${GOPATH%%:*} + CRITEST=${GOPATH}/bin/critest CRITEST_PKG=github.com/kubernetes-incubator/cri-tools CRICONTAINERD_SOCK=/var/run/cri-containerd.sock diff --git a/hack/test-e2e-node.sh b/hack/test-e2e-node.sh index 3cf46303d..10fe7a540 100755 --- a/hack/test-e2e-node.sh +++ b/hack/test-e2e-node.sh @@ -28,6 +28,7 @@ export FOCUS=${FOCUS:-""} export SKIP=${SKIP:-${DEFAULT_SKIP}} REPORT_DIR=${REPORT_DIR:-"/tmp/test-e2e-node"} +# Check GOPATH if [[ -z "${GOPATH}" ]]; then echo "GOPATH is not set" 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 fi +# For multiple GOPATHs, keep the first one only +GOPATH=${GOPATH%%:*} + # Get kubernetes KUBERNETES_REPO="https://github.com/kubernetes/kubernetes" KUBERNETES_PATH="${GOPATH}/src/k8s.io/kubernetes"