mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Merge pull request #24594 from wojtek-t/fix_protobuf_verifier
Fix verification script for proto-generation
This commit is contained in:
commit
9ec92559e5
@ -32,7 +32,7 @@ if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3.0."* ]]; the
|
||||
echo " https://github.com/google/protobuf/releases"
|
||||
echo
|
||||
echo "WARNING: Protobuf changes are not being validated"
|
||||
exit 0
|
||||
exit 1
|
||||
fi
|
||||
|
||||
gotoprotobuf=$(kube::util::find-binary "go-to-protobuf")
|
||||
|
@ -21,19 +21,7 @@ set -o pipefail
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
# TODO: preinstall protobuf
|
||||
if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3.0."* ]]; 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/google/protobuf/releases"
|
||||
echo
|
||||
echo "WARNING: Protobuf changes are not being validated"
|
||||
# TODO: make error when protobuf is installed
|
||||
exit 0
|
||||
fi
|
||||
|
||||
APIROOTS=${APIROOTS:-pkg/api pkg/apis/extensions pkg/apis/metrics pkg/runtime pkg/util/intstr}
|
||||
APIROOTS=${APIROOTS:-pkg/api pkg/apis pkg/runtime pkg/util/intstr pkg/watch}
|
||||
_tmp="${KUBE_ROOT}/_tmp"
|
||||
|
||||
cleanup() {
|
||||
@ -42,18 +30,24 @@ cleanup() {
|
||||
|
||||
trap "cleanup" EXIT SIGINT
|
||||
|
||||
cleanup
|
||||
for APIROOT in ${APIROOTS}; do
|
||||
mkdir -p "${_tmp}/${APIROOT%/*}"
|
||||
cp -a "${KUBE_ROOT}/${APIROOT}" "${_tmp}/${APIROOT}"
|
||||
done
|
||||
|
||||
"${KUBE_ROOT}/hack/after-build/update-generated-protobuf.sh"
|
||||
# We would like to use "sudo" when running on Travis and
|
||||
# not use "sudo" when running on Jenkins.
|
||||
SUDO="sudo"
|
||||
sudo -h > /dev/null || SUDO=""
|
||||
|
||||
"${KUBE_ROOT}/hack/update-generated-protobuf.sh"
|
||||
for APIROOT in ${APIROOTS}; do
|
||||
TMP_APIROOT="${_tmp}/${APIROOT}"
|
||||
echo "diffing ${APIROOT} against freshly generated protobuf"
|
||||
ret=0
|
||||
diff -Naupr -I 'Auto generated by' "${KUBE_ROOT}/${APIROOT}" "${TMP_APIROOT}" || ret=$?
|
||||
cp -a "${TMP_APIROOT}" "${KUBE_ROOT}/${APIROOT%/*}"
|
||||
${SUDO} cp -a "${TMP_APIROOT}" "${KUBE_ROOT}/${APIROOT%/*}"
|
||||
if [[ $ret -eq 0 ]]; then
|
||||
echo "${APIROOT} up to date."
|
||||
else
|
||||
|
@ -37,7 +37,12 @@ function prereqs() {
|
||||
KUBE_BUILD_CONTAINER_NAME="kube-build-${KUBE_ROOT_HASH}"
|
||||
KUBE_BUILD_DATA_CONTAINER_NAME="kube-build-data-${KUBE_ROOT_HASH}"
|
||||
DOCKER_MOUNT_ARGS=(
|
||||
--volume "${KUBE_ROOT}:/go/src/${KUBE_GO_PACKAGE}"
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}/cluster:/go/src/${KUBE_GO_PACKAGE}/cluster"
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}/cmd:/go/src/${KUBE_GO_PACKAGE}/cmd"
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}/Godeps/_workspace/src:/go/src/${KUBE_GO_PACKAGE}/Godeps/_workspace/src"
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}/hack:/go/src/${KUBE_GO_PACKAGE}/hack"
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}/pkg:/go/src/${KUBE_GO_PACKAGE}/pkg"
|
||||
--volume "${REPO_DIR:-${KUBE_ROOT}}/third_party:/go/src/${KUBE_GO_PACKAGE}/third_party"
|
||||
--volume /etc/localtime:/etc/localtime:ro
|
||||
--volumes-from "${KUBE_BUILD_DATA_CONTAINER_NAME}"
|
||||
)
|
||||
|
@ -23,8 +23,6 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/go-to-protobuf cmd/libs/go2idl/go-to-protobuf/protoc-gen-gogo
|
||||
|
||||
"${KUBE_ROOT}/hack/after-build/verify-generated-protobuf.sh" "$@"
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
|
@ -519,6 +519,8 @@ message EndpointAddress {
|
||||
// The IP of this endpoint.
|
||||
// May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16),
|
||||
// or link-local multicast ((224.0.0.0/24).
|
||||
// IPv6 is also accepted but not fully supported on all platforms. Also, certain
|
||||
// kubernetes components, like kube-proxy, are not IPv6 ready.
|
||||
// TODO: This should allow hostname or IP, See #4447.
|
||||
optional string ip = 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user