Update to use go modules (#671)

This includes updates to CI config, vendor files, etc.
I've hard-coded the k8s depedency at 1.13.4 to keep it inline with what
we currently have and to make sure a another run of `go mod tidy`
doesn't accidentally update it to an unexpected version.

Thanks to hectorj2f for carrying this along.
This commit is contained in:
Brian Goff
2019-06-19 08:17:22 -07:00
committed by Pires
parent f6f6c46b53
commit 77069e63e5
954 changed files with 138902 additions and 251590 deletions

View File

@@ -1,17 +0,0 @@
#!/usr/bin/env bash
exit_code=0
echo "==> Running dep check <=="
dep check || exit_code=1
if [ $exit_code -ne 0 ]; then
echo '`dep ensure` was not run. Make sure dependency changes are committed to the repository.'
echo 'You may also need to check that all deps are pinned to a commit or tag instead of a branch or HEAD.'
echo 'Check Gopkg.toml and Gopkg.lock'
else
echo "dep check passed."
fi
exit $exit_code

22
scripts/validate/gomod.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -e
exit_code=0
echo "==> Running go mod tidy to add missing and remove unused modules <=="
GO111MODULE=on go mod tidy || exit_code=1
if [ $exit_code -ne 0 ]; then
echo 'Checking go.mod and go.sum files'
else
echo "go mod tidy passed."
fi
git diff --exit-code go.mod go.sum vendor || exit_code=$?
if [ ${exit_code} -eq 0 ]; then
exit 0
fi
echo "please run \`go mod tidy\` and check in the changes"
exit ${exit_code}