Commit 0a981d49 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #50391 from pipejakob/get-kube-breakglass

Automatic merge from submit-queue (batch tested with PRs 49725, 50367, 50391, 48857, 50181) New get-kube.sh option: KUBERNETES_SKIP_RELEASE_VALIDATION **What this PR does / why we need it**: This is an alternative solution to https://github.com/kubernetes/kubernetes/pull/49884. The goal is to be able to pull releases that were built by bazel jobs (both presubmit and postsubmit builds), which currently fail our regex validation against the version string. This implementation is a simple "I know what I'm doing" breakglass option to turn regex validation off, whereas https://github.com/kubernetes/kubernetes/pull/49884 was to extend our validation to support the new formats of bazel build jobs. I'm testing the waters to see if this is a more palatable solution. **Release note**: ```release-note New get-kube.sh option: KUBERNETES_SKIP_RELEASE_VALIDATION ``` CC @BenTheElder @fejta @ixdy
parents e2b0d564 e77830c7
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
# Set KUBERNETES_SKIP_DOWNLOAD to skip downloading a release. # Set KUBERNETES_SKIP_DOWNLOAD to skip downloading a release.
# Set KUBERNETES_SKIP_CONFIRM to skip the installation confirmation prompt. # Set KUBERNETES_SKIP_CONFIRM to skip the installation confirmation prompt.
# Set KUBERNETES_SKIP_CREATE_CLUSTER to skip starting a cluster. # 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 errexit
set -o nounset set -o nounset
...@@ -179,13 +182,15 @@ release=${KUBERNETES_RELEASE:-"release/stable"} ...@@ -179,13 +182,15 @@ release=${KUBERNETES_RELEASE:-"release/stable"}
# Validate Kubernetes release version. # Validate Kubernetes release version.
# Translate a published version <bucket>/<version> (e.g. "release/stable") to version number. # Translate a published version <bucket>/<version> (e.g. "release/stable") to version number.
set_binary_version "${release}" set_binary_version "${release}"
if [[ ${KUBE_VERSION} =~ ${KUBE_CI_VERSION_REGEX} ]]; then if [[ -z "${KUBERNETES_SKIP_RELEASE_VALIDATION-}" ]]; then
# Override KUBERNETES_RELEASE_URL to point to the CI bucket; if [[ ${KUBE_VERSION} =~ ${KUBE_CI_VERSION_REGEX} ]]; then
# this will be used by get-kube-binaries.sh. # Override KUBERNETES_RELEASE_URL to point to the CI bucket;
KUBERNETES_RELEASE_URL="${KUBERNETES_CI_RELEASE_URL}" # this will be used by get-kube-binaries.sh.
elif ! [[ ${KUBE_VERSION} =~ ${KUBE_RELEASE_VERSION_REGEX} ]]; then KUBERNETES_RELEASE_URL="${KUBERNETES_CI_RELEASE_URL}"
echo "Version doesn't match regexp" >&2 elif ! [[ ${KUBE_VERSION} =~ ${KUBE_RELEASE_VERSION_REGEX} ]]; then
exit 1 echo "Version doesn't match regexp" >&2
exit 1
fi
fi fi
kubernetes_tar_url="${KUBERNETES_RELEASE_URL}/${KUBE_VERSION}/${file}" kubernetes_tar_url="${KUBERNETES_RELEASE_URL}/${KUBE_VERSION}/${file}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment