Update test-infra to the latest version (#154)

This commit is contained in:
Joyce Liu 2019-05-31 17:41:33 -07:00 committed by Knative Prow Robot
parent 9221429cb0
commit 43061af74a
5 changed files with 32 additions and 27 deletions

2
go.mod
View File

@ -20,7 +20,7 @@ require (
github.com/knative/build v0.6.0 // indirect github.com/knative/build v0.6.0 // indirect
github.com/knative/pkg v0.0.0-20190518173526-34792a92cec2 github.com/knative/pkg v0.0.0-20190518173526-34792a92cec2
github.com/knative/serving v0.6.0 github.com/knative/serving v0.6.0
github.com/knative/test-infra v0.0.0-20190529123930-7d0c44fb03a9 github.com/knative/test-infra v0.0.0-20190531180034-a3c073a2fea1
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a // indirect github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a // indirect
github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-homedir v1.1.0
github.com/modern-go/reflect2 v1.0.1 // indirect github.com/modern-go/reflect2 v1.0.1 // indirect

2
go.sum
View File

@ -151,6 +151,8 @@ github.com/knative/test-infra v0.0.0-20190517181617-d1bb39bbca6e h1:Is4Ki1oQhYD3
github.com/knative/test-infra v0.0.0-20190517181617-d1bb39bbca6e/go.mod h1:l77IWBscEV5T4sYb64/9iwRCVY4UXEIqMcAppsblHW4= github.com/knative/test-infra v0.0.0-20190517181617-d1bb39bbca6e/go.mod h1:l77IWBscEV5T4sYb64/9iwRCVY4UXEIqMcAppsblHW4=
github.com/knative/test-infra v0.0.0-20190529123930-7d0c44fb03a9 h1:2kupVzyk+zet/S5bHMAQLxt1rQzqTsJd+vUXp7tIYcI= github.com/knative/test-infra v0.0.0-20190529123930-7d0c44fb03a9 h1:2kupVzyk+zet/S5bHMAQLxt1rQzqTsJd+vUXp7tIYcI=
github.com/knative/test-infra v0.0.0-20190529123930-7d0c44fb03a9/go.mod h1:l77IWBscEV5T4sYb64/9iwRCVY4UXEIqMcAppsblHW4= github.com/knative/test-infra v0.0.0-20190529123930-7d0c44fb03a9/go.mod h1:l77IWBscEV5T4sYb64/9iwRCVY4UXEIqMcAppsblHW4=
github.com/knative/test-infra v0.0.0-20190531180034-a3c073a2fea1 h1:Y2QunZIzGuyvBNfWNpwK9/AAgu2P+Aa+k/3ykATGw30=
github.com/knative/test-infra v0.0.0-20190531180034-a3c073a2fea1/go.mod h1:l77IWBscEV5T4sYb64/9iwRCVY4UXEIqMcAppsblHW4=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=

View File

@ -300,6 +300,10 @@ function setup_test_cluster() {
export KO_DOCKER_REPO=gcr.io/${E2E_PROJECT_ID}/${E2E_BASE_NAME}-e2e-img export KO_DOCKER_REPO=gcr.io/${E2E_PROJECT_ID}/${E2E_BASE_NAME}-e2e-img
fi fi
# Safety checks
is_protected_gcr ${KO_DOCKER_REPO} && \
abort "\$KO_DOCKER_REPO set to ${KO_DOCKER_REPO}, which is forbidden"
echo "- Project is ${E2E_PROJECT_ID}" echo "- Project is ${E2E_PROJECT_ID}"
echo "- Cluster is ${k8s_cluster}" echo "- Cluster is ${k8s_cluster}"
echo "- User is ${k8s_user}" echo "- User is ${k8s_user}"
@ -423,10 +427,6 @@ function initialize() {
(( IS_PROW )) && [[ -z "${GCP_PROJECT}" ]] && IS_BOSKOS=1 (( IS_PROW )) && [[ -z "${GCP_PROJECT}" ]] && IS_BOSKOS=1
# Safety checks
is_protected_gcr ${KO_DOCKER_REPO} && \
abort "\$KO_DOCKER_REPO set to ${KO_DOCKER_REPO}, which is forbidden"
(( SKIP_ISTIO_ADDON )) || GKE_ADDONS="--addons=Istio" (( SKIP_ISTIO_ADDON )) || GKE_ADDONS="--addons=Istio"
readonly RUN_TESTS readonly RUN_TESTS

View File

@ -331,17 +331,10 @@ function report_go_test() {
function start_latest_knative_serving() { function start_latest_knative_serving() {
header "Starting Knative Serving" header "Starting Knative Serving"
subheader "Installing Knative Serving" subheader "Installing Knative Serving"
echo "Installing Serving from ${KNATIVE_SERVING_RELEASE}" echo "Installing Serving CRDs from ${KNATIVE_SERVING_RELEASE}"
# Some CRDs defined in serving YAML are also referenced by other components in serving. As it takes kubectl apply --selector knative.dev/crd-install=true -f ${KNATIVE_SERVING_RELEASE}
# time for CRDs to become effective, there is a race condition between when the CRDs are effective echo "Installing the rest of serving components from ${KNATIVE_SERVING_RELEASE}"
# and when the resources that references those CRDs are created. kubectl apply -f ${KNATIVE_SERVING_RELEASE}
# The current workaround is to re-apply serving.yaml if it fails. Remove the retry logic after the
# race condition is fixed. (https://github.com/knative/serving/issues/4176)
if ! kubectl apply -f ${KNATIVE_SERVING_RELEASE}; then
echo "Install failed, waiting 60s and then retrying..."
sleep 60
kubectl apply -f ${KNATIVE_SERVING_RELEASE} || return 1
fi
wait_until_pods_running knative-serving || return 1 wait_until_pods_running knative-serving || return 1
} }
@ -475,21 +468,32 @@ function get_canonical_path() {
echo "$(cd ${path%/*} && echo $PWD/${path##*/})" echo "$(cd ${path%/*} && echo $PWD/${path##*/})"
} }
# Return the base url we use to build the actual knative yaml sources. # Returns the URL to the latest manifest for the given Knative project.
function get_knative_base_yaml_source() { # Parameters: $1 - repository name of the given project
local knative_base_yaml_source="https://storage.googleapis.com/knative-nightly/@/latest" # $2 - name of the yaml file, without extension
function get_latest_knative_yaml_source() {
local branch_name="" local branch_name=""
local repo_name="$1"
local yaml_name="$2"
# Get the branch name from Prow's env var, see https://github.com/kubernetes/test-infra/blob/master/prow/jobs.md. # Get the branch name from Prow's env var, see https://github.com/kubernetes/test-infra/blob/master/prow/jobs.md.
# Otherwise, try getting the current branch from git. # Otherwise, try getting the current branch from git.
(( IS_PROW )) && branch_name="${PULL_BASE_REF:-}" (( IS_PROW )) && branch_name="${PULL_BASE_REF:-}"
[[ -z "${branch_name}" ]] && branch_name="$(git rev-parse --abbrev-ref HEAD)" [[ -z "${branch_name}" ]] && branch_name="$(git rev-parse --abbrev-ref HEAD)"
# If it's a release branch, base URL should point to a specific version. # If it's a release branch, the yaml source URL should point to a specific version.
if [[ ${branch_name} =~ ^release-[0-9\.]+$ ]]; then if [[ ${branch_name} =~ ^release-[0-9\.]+$ ]]; then
# Get the latest tag name for the current branch, which is likely formatted as v0.5.0 # Get the latest tag name for the current branch, which is likely formatted as v0.5.0
local tag_name="$(git describe --tags --abbrev=0)" local tag_name="$(git describe --tags --abbrev=0)"
knative_base_yaml_source="https://storage.googleapis.com/knative-releases/@/previous/${tag_name}" # The given repo might not have this tag, so we need to find its latest release manifest with the same major&minor version.
local major_minor="$(echo ${tag_name} | cut -d. -f1-2)"
local yaml_source_path="$(gsutil ls gs://knative-releases/${repo_name}/previous/${major_minor}.*/${yaml_name}.yaml \
| sort \
| tail -n 1 \
| cut -b6-)"
echo "https://storage.googleapis.com/${yaml_source_path}"
# If it's not a release branch, the yaml source URL should be nightly build.
else
echo "https://storage.googleapis.com/knative-nightly/${repo_name}/latest/${yaml_name}.yaml"
fi fi
echo "${knative_base_yaml_source}"
} }
# Initializations that depend on previous functions. # Initializations that depend on previous functions.
@ -499,7 +503,6 @@ readonly _TEST_INFRA_SCRIPTS_DIR="$(dirname $(get_canonical_path ${BASH_SOURCE[0
readonly REPO_NAME_FORMATTED="Knative $(capitalize ${REPO_NAME//-/})" readonly REPO_NAME_FORMATTED="Knative $(capitalize ${REPO_NAME//-/})"
# Public latest nightly or release yaml files. # Public latest nightly or release yaml files.
readonly KNATIVE_BASE_YAML_SOURCE="$(get_knative_base_yaml_source)" readonly KNATIVE_SERVING_RELEASE="$(get_latest_knative_yaml_source "serving" "serving")"
readonly KNATIVE_SERVING_RELEASE="${KNATIVE_BASE_YAML_SOURCE/@/serving}/serving.yaml" readonly KNATIVE_BUILD_RELEASE="$(get_latest_knative_yaml_source "build" "build")"
readonly KNATIVE_BUILD_RELEASE="${KNATIVE_BASE_YAML_SOURCE/@/build}/build.yaml" readonly KNATIVE_EVENTING_RELEASE="$(get_latest_knative_yaml_source "eventing" "release")"
readonly KNATIVE_EVENTING_RELEASE="${KNATIVE_BASE_YAML_SOURCE/@/eventing}/release.yaml"

2
vendor/modules.txt vendored
View File

@ -84,7 +84,7 @@ github.com/knative/serving/pkg/client/clientset/versioned/scheme
github.com/knative/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake github.com/knative/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake
github.com/knative/serving/pkg/apis/config github.com/knative/serving/pkg/apis/config
github.com/knative/serving/pkg/apis/autoscaling/v1alpha1 github.com/knative/serving/pkg/apis/autoscaling/v1alpha1
# github.com/knative/test-infra v0.0.0-20190529123930-7d0c44fb03a9 # github.com/knative/test-infra v0.0.0-20190531180034-a3c073a2fea1
github.com/knative/test-infra/scripts github.com/knative/test-infra/scripts
# github.com/magiconair/properties v1.8.0 # github.com/magiconair/properties v1.8.0
github.com/magiconair/properties github.com/magiconair/properties