mirror of https://github.com/knative/client.git
update test-infra in vendor (#148)
This commit is contained in:
parent
bfd5b56c3f
commit
cf41ab2b73
2
go.mod
2
go.mod
|
|
@ -20,7 +20,7 @@ require (
|
|||
github.com/knative/build v0.6.0 // indirect
|
||||
github.com/knative/pkg v0.0.0-20190518173526-34792a92cec2
|
||||
github.com/knative/serving v0.6.0
|
||||
github.com/knative/test-infra v0.0.0-20190517181617-d1bb39bbca6e
|
||||
github.com/knative/test-infra v0.0.0-20190529123930-7d0c44fb03a9
|
||||
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0
|
||||
github.com/modern-go/reflect2 v1.0.1 // indirect
|
||||
|
|
|
|||
2
go.sum
2
go.sum
|
|
@ -149,6 +149,8 @@ github.com/knative/test-infra v0.0.0-20190516041915-e83cf0ab6b1d h1:o0QEmZJb46wF
|
|||
github.com/knative/test-infra v0.0.0-20190516041915-e83cf0ab6b1d/go.mod h1:l77IWBscEV5T4sYb64/9iwRCVY4UXEIqMcAppsblHW4=
|
||||
github.com/knative/test-infra v0.0.0-20190517181617-d1bb39bbca6e h1:Is4Ki1oQhYD3Twfdzpk2U/vI/5hSPh9277bI1AK+28o=
|
||||
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/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/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=
|
||||
|
|
|
|||
|
|
@ -257,11 +257,17 @@ function create_test_cluster_with_retries() {
|
|||
kubetest "$@" ${geoflag}; } 2>&1 | tee ${cluster_creation_log}
|
||||
|
||||
# Exit if test succeeded
|
||||
[[ "$(get_test_return_code)" == "0" ]] && return
|
||||
# If test failed not because of cluster creation stockout, return
|
||||
[[ -z "$(grep -Eio 'does not have enough resources available to fulfill' ${cluster_creation_log})" ]] && return
|
||||
[[ "$(get_test_return_code)" == "0" ]] && return 0
|
||||
# Retry if cluster creation failed because of:
|
||||
# - stockout (https://github.com/knative/test-infra/issues/592)
|
||||
# - latest GKE not available in this region/zone yet (https://github.com/knative/test-infra/issues/694)
|
||||
[[ -z "$(grep -Fo 'does not have enough resources available to fulfill' ${cluster_creation_log})" \
|
||||
&& -z "$(grep -Fo 'ResponseError: code=400, message=No valid versions with the prefix' ${cluster_creation_log})" ]] \
|
||||
&& return 1
|
||||
done
|
||||
done
|
||||
echo "No more region/zones to try, quitting"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Setup the test cluster for running the tests.
|
||||
|
|
@ -273,7 +279,7 @@ function setup_test_cluster() {
|
|||
header "Setting up test cluster"
|
||||
|
||||
# Set the actual project the test cluster resides in
|
||||
# It will be a project assigned by Boskos if test is running on Prow,
|
||||
# It will be a project assigned by Boskos if test is running on Prow,
|
||||
# otherwise will be ${GCP_PROJECT} set up by user.
|
||||
readonly export E2E_PROJECT_ID="$(gcloud config get-value project)"
|
||||
|
||||
|
|
@ -283,6 +289,9 @@ function setup_test_cluster() {
|
|||
local k8s_user=$(gcloud config get-value core/account)
|
||||
local k8s_cluster=$(kubectl config current-context)
|
||||
|
||||
is_protected_cluster ${k8s_cluster} && \
|
||||
abort "kubeconfig context set to ${k8s_cluster}, which is forbidden"
|
||||
|
||||
# If cluster admin role isn't set, this is a brand new cluster
|
||||
# Setup the admin role and also KO_DOCKER_REPO
|
||||
if [[ -z "$(kubectl get clusterrolebinding cluster-admin-binding 2> /dev/null)" ]]; then
|
||||
|
|
@ -305,6 +314,8 @@ function setup_test_cluster() {
|
|||
set +o pipefail
|
||||
|
||||
if (( ! SKIP_KNATIVE_SETUP )) && function_exists knative_setup; then
|
||||
# Wait for Istio installation to complete, if necessary, before calling knative_setup.
|
||||
(( ! SKIP_ISTIO_ADDON )) && (wait_until_batch_job_complete istio-system || return 1)
|
||||
knative_setup || fail_test "Knative setup failed"
|
||||
fi
|
||||
if function_exists test_setup; then
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@
|
|||
# to be used in test scripts and the like. It doesn't do anything when
|
||||
# called from command line.
|
||||
|
||||
# GCP project where all tests related resources live
|
||||
readonly KNATIVE_TESTS_PROJECT=knative-tests
|
||||
|
||||
# Default GKE version to be used with Knative Serving
|
||||
readonly SERVING_GKE_VERSION=gke-latest
|
||||
readonly SERVING_GKE_IMAGE=cos
|
||||
|
|
@ -70,7 +73,7 @@ function abort() {
|
|||
# $2 - banner message.
|
||||
function make_banner() {
|
||||
local msg="$1$1$1$1 $2 $1$1$1$1"
|
||||
local border="${msg//[-0-9A-Za-z _.,\/()]/$1}"
|
||||
local border="${msg//[-0-9A-Za-z _.,\/()\']/$1}"
|
||||
echo -e "${border}\n${msg}\n${border}"
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +332,16 @@ function start_latest_knative_serving() {
|
|||
header "Starting Knative Serving"
|
||||
subheader "Installing Knative Serving"
|
||||
echo "Installing Serving from ${KNATIVE_SERVING_RELEASE}"
|
||||
kubectl apply -f ${KNATIVE_SERVING_RELEASE} || return 1
|
||||
# Some CRDs defined in serving YAML are also referenced by other components in serving. As it takes
|
||||
# time for CRDs to become effective, there is a race condition between when the CRDs are effective
|
||||
# and when the resources that references those CRDs are created.
|
||||
# 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
|
||||
}
|
||||
|
||||
|
|
@ -415,7 +427,20 @@ function is_int() {
|
|||
# Return whether the given parameter is the knative release/nightly GCF.
|
||||
# Parameters: $1 - full GCR name, e.g. gcr.io/knative-foo-bar
|
||||
function is_protected_gcr() {
|
||||
[[ -n $1 && "$1" =~ "^gcr.io/knative-(releases|nightly)/?$" ]]
|
||||
[[ -n $1 && $1 =~ ^gcr.io/knative-(releases|nightly)/?$ ]]
|
||||
}
|
||||
|
||||
# Return whether the given parameter is any cluster under ${KNATIVE_TESTS_PROJECT}.
|
||||
# Parameters: $1 - Kubernetes cluster context (output of kubectl config current-context)
|
||||
function is_protected_cluster() {
|
||||
# Example: gke_knative-tests_us-central1-f_prow
|
||||
[[ -n $1 && $1 =~ ^gke_${KNATIVE_TESTS_PROJECT}_us\-[a-zA-Z0-9]+\-[a-z]+_[a-z0-9\-]+$ ]]
|
||||
}
|
||||
|
||||
# Return whether the given parameter is ${KNATIVE_TESTS_PROJECT}.
|
||||
# Parameters: $1 - project name
|
||||
function is_protected_project() {
|
||||
[[ -n $1 && "$1" == "${KNATIVE_TESTS_PROJECT}" ]]
|
||||
}
|
||||
|
||||
# Remove symlinks in a path that are broken or lead outside the repo.
|
||||
|
|
@ -439,12 +464,6 @@ function remove_broken_symlinks() {
|
|||
done
|
||||
}
|
||||
|
||||
# Return whether the given parameter is knative-tests.
|
||||
# Parameters: $1 - project name
|
||||
function is_protected_project() {
|
||||
[[ -n "$1" && "$1" == "knative-tests" ]]
|
||||
}
|
||||
|
||||
# Returns the canonical path of a filesystem object.
|
||||
# Parameters: $1 - path to return in canonical form
|
||||
# $2 - base dir for relative links; optional, defaults to current
|
||||
|
|
@ -459,14 +478,13 @@ function get_canonical_path() {
|
|||
# Return the base url we use to build the actual knative yaml sources.
|
||||
function get_knative_base_yaml_source() {
|
||||
local knative_base_yaml_source="https://storage.googleapis.com/knative-nightly/@/latest"
|
||||
# Get the branch name from Prow's env var by default, see https://github.com/kubernetes/test-infra/blob/master/prow/jobs.md.
|
||||
local branch_name="${PULL_BASE_REF}"
|
||||
if (( ! IS_PROW )); then
|
||||
# If the test job is not running on Prow, we get the branch name directly via git command.
|
||||
branch_name="$(git rev-parse --abbrev-ref HEAD)"
|
||||
fi
|
||||
# If it's a release branch, we should have a different knative_base_yaml_source.
|
||||
if [[ $branch_name =~ ^release-[0-9\.]+$ ]]; then
|
||||
local branch_name=""
|
||||
# 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.
|
||||
(( IS_PROW )) && branch_name="${PULL_BASE_REF:-}"
|
||||
[[ -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 [[ ${branch_name} =~ ^release-[0-9\.]+$ ]]; then
|
||||
# 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)"
|
||||
knative_base_yaml_source="https://storage.googleapis.com/knative-releases/@/previous/${tag_name}"
|
||||
|
|
|
|||
|
|
@ -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/apis/config
|
||||
github.com/knative/serving/pkg/apis/autoscaling/v1alpha1
|
||||
# github.com/knative/test-infra v0.0.0-20190517181617-d1bb39bbca6e
|
||||
# github.com/knative/test-infra v0.0.0-20190529123930-7d0c44fb03a9
|
||||
github.com/knative/test-infra/scripts
|
||||
# github.com/magiconair/properties v1.8.0
|
||||
github.com/magiconair/properties
|
||||
|
|
|
|||
Loading…
Reference in New Issue