mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Merge pull request #26458 from david-mcmahon/godep-version
Automatic merge from submit-queue Check for a valid godep version.
This commit is contained in:
commit
421c12e69e
@ -263,6 +263,33 @@ kube::golang::create_gopath_tree() {
|
|||||||
ln -s "${KUBE_ROOT}" "${go_pkg_dir}"
|
ln -s "${KUBE_ROOT}" "${go_pkg_dir}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Ensure the godep tool exists and is a viable version.
|
||||||
|
kube::golang::verify_godep_version() {
|
||||||
|
local -a godep_version_string
|
||||||
|
local godep_version
|
||||||
|
local godep_min_version="63"
|
||||||
|
|
||||||
|
if ! which godep &>/dev/null; then
|
||||||
|
kube::log::usage_from_stdin <<EOF
|
||||||
|
Can't find 'godep' in PATH, please fix and retry.
|
||||||
|
See https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md#godep-and-dependency-management for installation instructions.
|
||||||
|
EOF
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
godep_version_string=($(godep version))
|
||||||
|
godep_version=${godep_version_string[1]/v/}
|
||||||
|
if ((godep_version<$godep_min_version)); then
|
||||||
|
kube::log::usage_from_stdin <<EOF
|
||||||
|
Detected godep version: ${godep_version_string[*]}.
|
||||||
|
Kubernetes requires godep v$godep_min_version or greater.
|
||||||
|
Please update:
|
||||||
|
go get -u github.com/tools/godep
|
||||||
|
EOF
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Ensure the go tool exists and is a viable version.
|
# Ensure the go tool exists and is a viable version.
|
||||||
kube::golang::verify_go_version() {
|
kube::golang::verify_go_version() {
|
||||||
if [[ -z "$(which go)" ]]; then
|
if [[ -z "$(which go)" ]]; then
|
||||||
|
@ -41,6 +41,7 @@ preload-dep() {
|
|||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
|
kube::golang::verify_godep_version
|
||||||
|
|
||||||
readonly branch=${1:-${KUBE_VERIFY_GIT_BRANCH:-master}}
|
readonly branch=${1:-${KUBE_VERIFY_GIT_BRANCH:-master}}
|
||||||
if ! [[ ${KUBE_FORCE_VERIFY_CHECKS:-} =~ ^[yY]$ ]] && \
|
if ! [[ ${KUBE_FORCE_VERIFY_CHECKS:-} =~ ^[yY]$ ]] && \
|
||||||
|
Loading…
Reference in New Issue
Block a user