mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Merge pull request #42726 from sttts/sttts-unify-godep-scripts
Automatic merge from submit-queue Ensure a fixed godep version in hack/*-godep*.sh No godep pinning asks for trouble when godep changes behaviour once again. Moreover, call `hack/godep-restore.go` from `hack/update-all-staging.sh`. This was an actual bug.
This commit is contained in:
commit
376282227f
@ -20,9 +20,10 @@ set -o pipefail
|
|||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
export GOPATH=${GOPATH}:${KUBE_ROOT}/staging
|
source "${KUBE_ROOT}/hack/lib/util.sh"
|
||||||
GODEP="${GODEP:-godep}"
|
|
||||||
|
kube::util::ensure_godep_version v74
|
||||||
|
|
||||||
echo "Starting to download all kubernetes godeps. This takes a while"
|
echo "Starting to download all kubernetes godeps. This takes a while"
|
||||||
"${GODEP}" restore "$@"
|
GOPATH=${GOPATH}:${KUBE_ROOT}/staging godep restore "$@"
|
||||||
echo "Download finished"
|
echo "Download finished"
|
||||||
|
@ -20,9 +20,9 @@ set -o pipefail
|
|||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
export GOPATH=${GOPATH}:${KUBE_ROOT}/staging
|
source "${KUBE_ROOT}/hack/lib/util.sh"
|
||||||
GODEP="${GODEP:-godep}"
|
|
||||||
|
|
||||||
|
kube::util::ensure_godep_version v74
|
||||||
|
|
||||||
# Some things we want in godeps aren't code dependencies, so ./...
|
# Some things we want in godeps aren't code dependencies, so ./...
|
||||||
# won't pick them up.
|
# won't pick them up.
|
||||||
@ -34,8 +34,8 @@ REQUIRED_BINS=(
|
|||||||
)
|
)
|
||||||
|
|
||||||
pushd "${KUBE_ROOT}" > /dev/null
|
pushd "${KUBE_ROOT}" > /dev/null
|
||||||
"${GODEP}" version
|
GOPATH=${GOPATH}:${KUBE_ROOT}/staging godep save "${REQUIRED_BINS[@]}"
|
||||||
GO15VENDOREXPERIMENT=1 ${GODEP} save "${REQUIRED_BINS[@]}"
|
|
||||||
# create a symlink in vendor directory pointing to the staging client. This
|
# create a symlink in vendor directory pointing to the staging client. This
|
||||||
# let other packages use the staging client as if it were vendored.
|
# let other packages use the staging client as if it were vendored.
|
||||||
if [ ! -e "vendor/k8s.io/client-go" ]; then
|
if [ ! -e "vendor/k8s.io/client-go" ]; then
|
||||||
|
@ -20,10 +20,13 @@ set -o nounset
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||||
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
|
source "${KUBE_ROOT}/hack/lib/util.sh"
|
||||||
source "${KUBE_ROOT}/cluster/lib/util.sh"
|
source "${KUBE_ROOT}/cluster/lib/util.sh"
|
||||||
|
|
||||||
SILENT=true
|
SILENT=true
|
||||||
ALL=false
|
ALL=false
|
||||||
|
V=""
|
||||||
|
|
||||||
while getopts ":va" opt; do
|
while getopts ":va" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
@ -32,6 +35,7 @@ while getopts ":va" opt; do
|
|||||||
;;
|
;;
|
||||||
v)
|
v)
|
||||||
SILENT=false
|
SILENT=false
|
||||||
|
V="-v"
|
||||||
;;
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid flag: -$OPTARG" >&2
|
echo "Invalid flag: -$OPTARG" >&2
|
||||||
@ -50,6 +54,13 @@ if ! $ALL ; then
|
|||||||
echo "Running in short-circuit mode; run with -a to force all scripts to run."
|
echo "Running in short-circuit mode; run with -a to force all scripts to run."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
kube::util::ensure_godep_version v74
|
||||||
|
|
||||||
|
if ! kube::util::godep_restored 2>&1 | sed 's/^/ /'; then
|
||||||
|
echo "Running godep restore"
|
||||||
|
"${KUBE_ROOT}/hack/godep-restore.sh" ${V}
|
||||||
|
fi
|
||||||
|
|
||||||
BASH_TARGETS="
|
BASH_TARGETS="
|
||||||
update-generated-protobuf
|
update-generated-protobuf
|
||||||
update-codegen
|
update-codegen
|
||||||
@ -64,9 +75,8 @@ BASH_TARGETS="
|
|||||||
update-staging-godeps
|
update-staging-godeps
|
||||||
update-bazel"
|
update-bazel"
|
||||||
|
|
||||||
for t in $BASH_TARGETS
|
for t in $BASH_TARGETS; do
|
||||||
do
|
echo -e "${color_yellow}Updating $t${color_norm}"
|
||||||
echo -e "${color_yellow}Running $t${color_norm}"
|
|
||||||
if $SILENT ; then
|
if $SILENT ; then
|
||||||
if ! bash "$KUBE_ROOT/hack/$t.sh" 1> /dev/null; then
|
if ! bash "$KUBE_ROOT/hack/$t.sh" 1> /dev/null; then
|
||||||
echo -e "${color_red}Running $t FAILED${color_norm}"
|
echo -e "${color_red}Running $t FAILED${color_norm}"
|
||||||
|
Loading…
Reference in New Issue
Block a user