Skip to content

Commit

Permalink
Fix build for multiple GOPATHs
Browse files Browse the repository at this point in the history
The build script doesn't work when people have GOPATH like
/path/a:/path/b

Signed-off-by: Yongkun Anfernee Gui <agui@vmware.com>
  • Loading branch information
Yongkun Anfernee Gui committed Sep 1, 2017
1 parent 7923171 commit 5da08bd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hack/install-deps.sh
Expand Up @@ -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}
Expand Down
4 changes: 4 additions & 0 deletions hack/test-cri.sh
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions hack/test-e2e-node.sh
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 5da08bd

Please sign in to comment.