Check protoc version strictly

This commit is contained in:
Jordan Liggitt
2023-01-23 09:11:06 -05:00
parent f21c603417
commit 238e0226db
4 changed files with 21 additions and 19 deletions

View File

@@ -25,22 +25,14 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
source "${KUBE_ROOT}/hack/lib/protoc.sh"
kube::protoc::check_protoc
kube::golang::setup_env
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf
GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo
if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3."* ]]; then
echo "Generating protobuf requires protoc 3.0.0-beta1 or newer. Please download and"
echo "install the platform appropriate Protobuf package for your OS: "
echo
echo " https://github.com/protocolbuffers/protobuf/releases"
echo
echo "WARNING: Protobuf changes are not being validated"
exit 1
fi
gotoprotobuf=$(kube::util::find-binary "go-to-protobuf")
# requires the 'proto' tag to build (will remove when ready)