Skip to content

Commit 588efa2

Browse files
Merge pull request #17921 from soltysh/glide_check
Automatic merge from submit-queue. Check glide version Same thing as in openshift/client-go#19 /assign @deads2k @stevekuznetsov
2 parents b41d1da + 44ce176 commit 588efa2

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

Diff for: hack/lib/constants.sh

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ readonly OS_GO_PACKAGE=github.com/openshift/origin
77
readonly OS_BUILD_ENV_GOLANG="${OS_BUILD_ENV_GOLANG:-1.9}"
88
readonly OS_BUILD_ENV_IMAGE="${OS_BUILD_ENV_IMAGE:-openshift/origin-release:golang-${OS_BUILD_ENV_GOLANG}}"
99
readonly OS_REQUIRED_GO_VERSION="go${OS_BUILD_ENV_GOLANG}"
10+
readonly OS_GLIDE_MINOR_VERSION="13"
11+
readonly OS_REQUIRED_GLIDE_VERSION="0.$OS_GLIDE_MINOR_VERSION"
1012

1113
readonly OS_GOFLAGS_TAGS="include_gcs include_oss containers_image_openpgp"
1214
readonly OS_GOFLAGS_TAGS_LINUX_AMD64="gssapi"

Diff for: hack/lib/util/golang.sh

+16-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# This library holds golang related utility functions.
44

5-
# os::golang::verify_go_version ensure the go tool exists and is a viable version.
5+
# os::golang::verify_go_version ensures the go tool exists and is a viable version.
66
function os::golang::verify_go_version() {
77
os::util::ensure::system_binary_exists 'go'
88

@@ -11,8 +11,7 @@ function os::golang::verify_go_version() {
1111
if [[ "${go_version[2]}" < "${OS_REQUIRED_GO_VERSION}" ]]; then
1212
os::log::info "Detected go version: ${go_version[*]}."
1313
if [[ -z "${PERMISSIVE_GO:-}" ]]; then
14-
os::log::warning "Please install Go version ${OS_REQUIRED_GO_VERSION} or use PERMISSIVE_GO=y to bypass this check."
15-
return 0
14+
os::log::fatal "Please install Go version ${OS_REQUIRED_GO_VERSION} or use PERMISSIVE_GO=y to bypass this check."
1615
else
1716
os::log::warning "Detected golang version doesn't match required Go version."
1817
os::log::warning "This version mismatch could lead to differences in execution between this run and the CI systems."
@@ -21,3 +20,17 @@ function os::golang::verify_go_version() {
2120
fi
2221
}
2322
readonly -f os::golang::verify_go_version
23+
24+
# os::golang::verify_glide_version ensures the glide is at the required level
25+
function os::golang::verify_glide_version() {
26+
os::util::ensure::system_binary_exists 'glide'
27+
28+
local glide_version
29+
glide_version=($(glide --version))
30+
if ! echo "${glide_version[2]#v}" | awk -F. -v min=$OS_GLIDE_MINOR_VERSION '{ exit $2 < min }'; then
31+
os::log::info "Detected glide version: ${glide_version[*]}."
32+
os::log::fatal "Please install Glide version ${OS_REQUIRED_GLIDE_VERSION} or newer."
33+
fi
34+
35+
}
36+
readonly -f os::golang::verify_glide_version

Diff for: hack/update-deps.sh

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ set -o pipefail
77
cd "$(dirname "${BASH_SOURCE}")/.."
88
source "$(dirname "${BASH_SOURCE}")/lib/init.sh"
99

10+
os::golang::verify_glide_version
11+
1012
# fail early if any of the staging dirs is checked out
1113
for pkg in "$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/"*; do
1214
dir=$(basename $pkg)

0 commit comments

Comments
 (0)