diff --git a/go.mod b/go.mod index 019404cf5..ecc1fa152 100644 --- a/go.mod +++ b/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-20190529123930-7d0c44fb03a9 + github.com/knative/test-infra v0.0.0-20190531180034-a3c073a2fea1 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 diff --git a/go.sum b/go.sum index 3cf994277..9cb00ba9c 100644 --- a/go.sum +++ b/go.sum @@ -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-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-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/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= diff --git a/vendor/github.com/knative/test-infra/scripts/e2e-tests.sh b/vendor/github.com/knative/test-infra/scripts/e2e-tests.sh index fb2bced10..b6faf49a7 100644 --- a/vendor/github.com/knative/test-infra/scripts/e2e-tests.sh +++ b/vendor/github.com/knative/test-infra/scripts/e2e-tests.sh @@ -300,6 +300,10 @@ function setup_test_cluster() { export KO_DOCKER_REPO=gcr.io/${E2E_PROJECT_ID}/${E2E_BASE_NAME}-e2e-img 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 "- Cluster is ${k8s_cluster}" echo "- User is ${k8s_user}" @@ -423,10 +427,6 @@ function initialize() { (( 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" readonly RUN_TESTS diff --git a/vendor/github.com/knative/test-infra/scripts/library.sh b/vendor/github.com/knative/test-infra/scripts/library.sh index 4d7206bf1..d3e98d5b0 100644 --- a/vendor/github.com/knative/test-infra/scripts/library.sh +++ b/vendor/github.com/knative/test-infra/scripts/library.sh @@ -331,17 +331,10 @@ function report_go_test() { function start_latest_knative_serving() { header "Starting Knative Serving" subheader "Installing Knative Serving" - echo "Installing Serving from ${KNATIVE_SERVING_RELEASE}" - # 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 + echo "Installing Serving CRDs from ${KNATIVE_SERVING_RELEASE}" + kubectl apply --selector knative.dev/crd-install=true -f ${KNATIVE_SERVING_RELEASE} + echo "Installing the rest of serving components from ${KNATIVE_SERVING_RELEASE}" + kubectl apply -f ${KNATIVE_SERVING_RELEASE} wait_until_pods_running knative-serving || return 1 } @@ -475,21 +468,32 @@ function get_canonical_path() { echo "$(cd ${path%/*} && echo $PWD/${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" +# Returns the URL to the latest manifest for the given Knative project. +# Parameters: $1 - repository name of the given project +# $2 - name of the yaml file, without extension +function get_latest_knative_yaml_source() { 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. # 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 it's a release branch, the yaml source 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}" + # 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 - echo "${knative_base_yaml_source}" } # 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//-/})" # Public latest nightly or release yaml files. -readonly KNATIVE_BASE_YAML_SOURCE="$(get_knative_base_yaml_source)" -readonly KNATIVE_SERVING_RELEASE="${KNATIVE_BASE_YAML_SOURCE/@/serving}/serving.yaml" -readonly KNATIVE_BUILD_RELEASE="${KNATIVE_BASE_YAML_SOURCE/@/build}/build.yaml" -readonly KNATIVE_EVENTING_RELEASE="${KNATIVE_BASE_YAML_SOURCE/@/eventing}/release.yaml" +readonly KNATIVE_SERVING_RELEASE="$(get_latest_knative_yaml_source "serving" "serving")" +readonly KNATIVE_BUILD_RELEASE="$(get_latest_knative_yaml_source "build" "build")" +readonly KNATIVE_EVENTING_RELEASE="$(get_latest_knative_yaml_source "eventing" "release")" diff --git a/vendor/modules.txt b/vendor/modules.txt index 3c0965aeb..a09b674b0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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-20190529123930-7d0c44fb03a9 +# github.com/knative/test-infra v0.0.0-20190531180034-a3c073a2fea1 github.com/knative/test-infra/scripts # github.com/magiconair/properties v1.8.0 github.com/magiconair/properties