Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion hack/install/install_cni.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -euo pipefail

CNI_VERSION=v0.7

# keep the first one only
GOPATH="${GOPATH%%:*}"

Expand All @@ -20,7 +22,14 @@ cni::install_cni() {
workdir="${GOPATH}/src/${pkg}"

# downloads github.com/containernetworking/plugins
go get -u -d "${pkg}"/...
if [ ! -d "${workdir}" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, the size of the source code package is smaller than the size of the .tgz. In addition, we will be freedom to operate the branch . So no need to change it, IMO. WDYT? Anyway, thanks for your advice. :)

mkdir -p "${workdir}"
cd "${workdir}"
git clone https://${pkg}.git .
fi
cd "${workdir}"
git fetch --all
git checkout "${CNI_VERSION}"

# build and copy into /opt/cni/bin
"${workdir}"/build.sh
Expand Down