From e77830c71d173ba0f90338402b3fa7d030dce733 Mon Sep 17 00:00:00 2001 From: Jacob Beacham Date: Wed, 9 Aug 2017 11:30:35 -0700 Subject: [PATCH] New get-kube.sh option: KUBERNETES_SKIP_RELEASE_VALIDATION --- cluster/get-kube.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/cluster/get-kube.sh b/cluster/get-kube.sh index 5ae6333eebb..1f910727e9f 100755 --- a/cluster/get-kube.sh +++ b/cluster/get-kube.sh @@ -56,6 +56,9 @@ # Set KUBERNETES_SKIP_DOWNLOAD to skip downloading a release. # Set KUBERNETES_SKIP_CONFIRM to skip the installation confirmation prompt. # Set KUBERNETES_SKIP_CREATE_CLUSTER to skip starting a cluster. +# Set KUBERNETES_SKIP_RELEASE_VALIDATION to skip trying to validate the +# Kubernetes release string. This implies that you know what you're doing +# and have set KUBERNETES_RELEASE and KUBERNETES_RELEASE_URL properly. set -o errexit set -o nounset @@ -179,13 +182,15 @@ release=${KUBERNETES_RELEASE:-"release/stable"} # Validate Kubernetes release version. # Translate a published version / (e.g. "release/stable") to version number. set_binary_version "${release}" -if [[ ${KUBE_VERSION} =~ ${KUBE_CI_VERSION_REGEX} ]]; then - # Override KUBERNETES_RELEASE_URL to point to the CI bucket; - # this will be used by get-kube-binaries.sh. - KUBERNETES_RELEASE_URL="${KUBERNETES_CI_RELEASE_URL}" -elif ! [[ ${KUBE_VERSION} =~ ${KUBE_RELEASE_VERSION_REGEX} ]]; then - echo "Version doesn't match regexp" >&2 - exit 1 +if [[ -z "${KUBERNETES_SKIP_RELEASE_VALIDATION-}" ]]; then + if [[ ${KUBE_VERSION} =~ ${KUBE_CI_VERSION_REGEX} ]]; then + # Override KUBERNETES_RELEASE_URL to point to the CI bucket; + # this will be used by get-kube-binaries.sh. + KUBERNETES_RELEASE_URL="${KUBERNETES_CI_RELEASE_URL}" + elif ! [[ ${KUBE_VERSION} =~ ${KUBE_RELEASE_VERSION_REGEX} ]]; then + echo "Version doesn't match regexp" >&2 + exit 1 + fi fi kubernetes_tar_url="${KUBERNETES_RELEASE_URL}/${KUBE_VERSION}/${file}"