Skip to content

Commit

Permalink
tests/e2e/manifests: pin the go version and install it using curl
Browse files Browse the repository at this point in the history
  • Loading branch information
neolit123 committed Mar 4, 2020
1 parent 98ed013 commit ce59755
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/e2e/manifests/verify_manifest_lists.sh
Expand Up @@ -16,21 +16,29 @@ trap "rm go.mod go.sum" EXIT

# install curl if missing
if ! `curl --version > /dev/null`; then
apt-get update || exit 1
apt-get install -y curl || exit 1
apt-get update
apt-get install -y curl
fi

# install go if missing
if ! `go version > /dev/null`; then
apt-get update || exit 1
apt-get install -y golang-go || exit 1
curl https://dl.google.com/go/go1.13.8.linux-amd64.tar.gz -o /tmp/go.tar.gz
tar -C /usr/local -xzf /tmp/go.tar.gz
export PATH="$PATH":/usr/local/go/bin
fi

# api-machinery requires gcc
# go: extracting k8s.io/apimachinery v0.17.3
# runtime/cgo
# exec: "gcc": executable file not found in $PATH
if ! `gcc -v > /dev/null`; then
apt-get install -y gcc
fi

LPATH=`dirname "$0"`
cd "$LPATH"

# use go modules. this forces using the latest k8s.io/apimachinery package.
export GO111MODULE=on
go mod init verify-manifest-lists

# run unit tests
Expand Down

0 comments on commit ce59755

Please sign in to comment.