New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrades and upgrade tests take versions of the form release/stable instead of stable_release #15519
Upgrades and upgrade tests take versions of the form release/stable instead of stable_release #15519
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,53 +18,59 @@ set -o errexit | |
set -o nounset | ||
set -o pipefail | ||
|
||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. | ||
|
||
source "${KUBE_ROOT}/cluster/common.sh" | ||
|
||
declare -r KUBE_RELEASE_BUCKET_URL="https://storage.googleapis.com/kubernetes-release" | ||
declare -r KUBE_TAR_NAME="kubernetes.tar.gz" | ||
|
||
usage() { | ||
echo "usage: | ||
$0 [stable|release|latest|latest-green] | ||
|
||
stable: latest stable version | ||
release: latest release candidate | ||
latest: latest ci build | ||
latest-green: latest ci build to pass gce e2e" | ||
echo "${0} [-v] <version number or publication>" | ||
echo " -v: Don't get tars, just print the version number" | ||
echo "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this breaks compatibility, not a big deal? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If people are scripting off of this, their scripts will definitely break. I thought that was a lesser evil than keeping these aliases around, but I'm definitely willing to be overruled. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm ok with it as well |
||
echo ' Version number or publication is either a proper version number' | ||
echo ' (e.g. "v1.0.6", "v1.2.0-alpha.1.881+376438b69c7612") or a version' | ||
echo ' publication of the form <bucket>/<version> (e.g. "release/stable",' | ||
echo ' "ci/latest-1"). Some common ones are:' | ||
echo ' - "release/stable"' | ||
echo ' - "release/latest"' | ||
echo ' - "ci/latest"' | ||
echo ' See the docs on getting builds for more information about version' | ||
echo ' publication.' | ||
} | ||
|
||
print_version=false | ||
|
||
while getopts ":vh" opt; do | ||
case ${opt} in | ||
v) | ||
print_version="true" | ||
;; | ||
h) | ||
usage | ||
exit 0 | ||
;; | ||
\?) | ||
echo "Invalid option: -$OPTARG" >&2 | ||
usage | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
shift $((OPTIND-1)) | ||
|
||
if [[ $# -ne 1 ]]; then | ||
usage | ||
exit 1 | ||
fi | ||
|
||
case "$1" in | ||
"latest") | ||
# latest ci version is written in the latest.txt in the /ci dir | ||
KUBE_TAR_RELATIVE_PATH="ci" | ||
KUBE_VERSION_FILE="latest.txt" | ||
;; | ||
"latest-green") | ||
# latest ci version to pass gce e2e is written in the latest-green.txt in the /ci dir | ||
KUBE_TAR_RELATIVE_PATH="ci" | ||
KUBE_VERSION_FILE="latest-green.txt" | ||
;; | ||
"stable") | ||
# latest stable release version is written in the stable.txt file in the /release dir | ||
KUBE_TAR_RELATIVE_PATH="release" | ||
KUBE_VERSION_FILE="stable.txt" | ||
;; | ||
"release") | ||
# latest release candidate version is written in latest.txt in the /release dir | ||
KUBE_TAR_RELATIVE_PATH="release" | ||
KUBE_VERSION_FILE="latest.txt" | ||
;; | ||
*) | ||
usage | ||
exit 1 | ||
;; | ||
esac | ||
set_binary_version ${1} | ||
|
||
KUBE_BINARY_DIRECTORY="${KUBE_RELEASE_BUCKET_URL}/${KUBE_TAR_RELATIVE_PATH}" | ||
KUBE_VERSION=$(curl --silent --fail "${KUBE_BINARY_DIRECTORY}/${KUBE_VERSION_FILE}") | ||
KUBE_BINARY_PATH="${KUBE_BINARY_DIRECTORY}/${KUBE_VERSION}/${KUBE_TAR_NAME}" | ||
|
||
curl --fail -o kubernetes-${KUBE_VERSION}.tar.gz "${KUBE_BINARY_PATH}" | ||
if [[ "${print_version}" == "true" ]]; then | ||
echo "${KUBE_VERSION}" | ||
else | ||
echo "Using version at ${1}: ${KUBE_VERSION}" >&2 | ||
tars_from_version | ||
curl --fail -o kubernetes-${KUBE_VERSION}.tar.gz "${KUBE_TAR_URL}" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: existence checks of gcs objects should use --head. This pattern was not introduced in this pr so we don't have to fix it here.
https://cloud.google.com/storage/docs/xml-api/head-object?hl=en
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack.