upgrade to latest dependencies (#5329)

bumping knative.dev/hack b035462...c12c1bf:
  > c12c1bf Revert of # 257 (# 258)
  > 6397aac 🐛 Don't use NodeLocalDNS addon (# 257)
  > 2e610ce Update community files (# 256)
  > de2ff40 Allow tests to skip dumping resources on failure (# 255)
  > 646aac0 e2e script tweaks (# 252)
  > d470f52 Format go code (# 253)

Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
knative-automation 2022-11-23 16:27:43 +00:00 committed by GitHub
parent ea93e78ef4
commit b06502df49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 24 deletions

2
go.mod
View File

@ -28,7 +28,7 @@ require (
gopkg.in/go-playground/webhooks.v3 v3.13.0
gopkg.in/yaml.v2 v2.3.0
honnef.co/go/tools v0.0.1-2020.1.5 // indirect
knative.dev/hack v0.0.0-20221114224536-b0354624aa29
knative.dev/hack v0.0.0-20221122182941-c12c1bfbd6d2
)
replace go.opencensus.io => go.opencensus.io v0.20.2

4
go.sum
View File

@ -538,8 +538,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
knative.dev/hack v0.0.0-20221114224536-b0354624aa29 h1:FUHfJXlY5e9wFuSf5JlMONy/fQbofS7hEBfOMXLHXso=
knative.dev/hack v0.0.0-20221114224536-b0354624aa29/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/hack v0.0.0-20221122182941-c12c1bfbd6d2 h1:/1qij7gQhnVLVH6hI8HqMBYUhMGurGcbqnHXwOKbWgs=
knative.dev/hack v0.0.0-20221122182941-c12c1bfbd6d2/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

View File

@ -123,6 +123,10 @@ This is a helper script for Knative E2E test scripts. To use it:
when a test fails, and can dump extra information about the current state of
the cluster (typically using `kubectl`).
1. [optional] Write the `on_success` function. It will be called when a test succeeds
1. [optional] Write the `on_failure` function. It will be called when a test fails
1. [optional] Write the `parse_flags()` function. It will be called whenever an
unrecognized flag is passed to the script, allowing you to define your own
flags. The function must return 0 if the flag is unrecognized, or the number

View File

@ -21,13 +21,8 @@ source "$(dirname "${BASH_SOURCE[0]:-$0}")/infra-library.sh"
readonly TEST_RESULT_FILE=/tmp/${REPO_NAME}-e2e-result
# Flag whether test is using a boskos GCP project
IS_BOSKOS=0
# Tear down the test resources.
function teardown_test_resources() {
# On boskos, save time and don't teardown as the cluster will be destroyed anyway.
(( IS_BOSKOS )) && return
header "Tearing down test environment"
if function_exists test_teardown; then
test_teardown
@ -89,10 +84,9 @@ function setup_test_cluster() {
kubectl config set-context "${k8s_cluster}" --namespace=default
echo "- Cluster is ${k8s_cluster}"
echo "- Docker is ${KO_DOCKER_REPO}"
echo "- KO_DOCKER_REPO is ${KO_DOCKER_REPO}"
# Do not run teardowns if we explicitly want to skip them.
(( ! SKIP_TEARDOWNS )) && add_trap teardown_test_resources EXIT
(( TEARDOWN )) && add_trap teardown_test_resources EXIT
# Handle failures ourselves, so we can dump useful info.
set +o errexit
@ -111,7 +105,7 @@ function success() {
echo "**************************************"
echo "*** E2E TESTS PASSED ***"
echo "**************************************"
dump_metrics
function_exists on_success && on_success
exit 0
}
@ -122,13 +116,18 @@ function fail_test() {
if [[ "X${message:-}X" == "XX" ]]; then
message='test failed'
fi
add_trap "dump_cluster_state;dump_metrics" EXIT
function_exists on_failure && on_failure
(( ! SKIP_DUMP_ON_FAILURE )) && dump_cluster_state
abort "${message}"
}
SKIP_TEARDOWNS=0
# Since create_test_cluster invokes the test script
# recursively we don't want to override these on the second
# invocation
TEARDOWN=${TEARDOWN:-0}
CLOUD_PROVIDER=${CLOUD_PROVIDER:-"gke"}
SKIP_DUMP_ON_FAILURE=${SKIP_DUMP_ON_FAILURE:-0}
E2E_SCRIPT=""
CLOUD_PROVIDER="gke"
# Parse flags and initialize the test cluster.
function initialize() {
@ -165,9 +164,10 @@ function initialize() {
# Try parsing flag as a standard one.
case ${parameter} in
--run-tests) run_tests=1 ;;
--skip-teardowns) SKIP_TEARDOWNS=1 ;;
--skip-istio-addon) echo "--skip-istio-addon is no longer supported"
;; # This flag is a noop
--teardown) TEARDOWN=1 ;;
--skip-teardowns) echo "--skip-teardowns is no longer supported - opt in with --teardown" ;;
--skip-dump-on-failure) SKIP_DUMP_ON_FAILURE=1 ;;
--skip-istio-addon) echo "--skip-istio-addon is no longer supported" ;;
*)
case ${parameter} in
--cloud-provider) shift; CLOUD_PROVIDER="$1" ;;
@ -177,14 +177,13 @@ function initialize() {
shift
done
(( IS_PROW )) && [[ -z "${GCP_PROJECT_ID:-}" ]] && IS_BOSKOS=1
if [[ "${CLOUD_PROVIDER}" == "gke" ]]; then
custom_flags+=("--addons=NodeLocalDNS")
fi
readonly IS_BOSKOS
readonly SKIP_TEARDOWNS
readonly SKIP_DUMP_ON_FAILURE
readonly TEARDOWN
readonly CLOUD_PROVIDER
if (( ! run_tests )); then
create_test_cluster "${CLOUD_PROVIDER}" custom_flags e2e_script_command

View File

@ -133,6 +133,12 @@ function create_gke_test_cluster() {
if [[ "${ENABLE_PREEMPTIBLE_NODES:-}" == "true" ]]; then
extra_gcloud_flags="${extra_gcloud_flags} --preemptible"
fi
if ! command -v kubetest2 >/dev/null; then
tmpbin="$(mktemp -d)"
echo "kubetest2 not found, installing in temp path: ${tmpbin}"
GOBIN="$tmpbin" go install sigs.k8s.io/kubetest2/...@latest
export PATH="${tmpbin}:${PATH}"
fi
run_kntest kubetest2 gke "${_custom_flags[@]}" \
--test-command="${_test_command[*]}" \
--extra-gcloud-flags="${extra_gcloud_flags}"

2
vendor/modules.txt vendored
View File

@ -286,7 +286,7 @@ gopkg.in/go-playground/webhooks.v3/github
gopkg.in/yaml.v2
# honnef.co/go/tools v0.0.1-2020.1.5
## explicit
# knative.dev/hack v0.0.0-20221114224536-b0354624aa29
# knative.dev/hack v0.0.0-20221122182941-c12c1bfbd6d2
## explicit
knative.dev/hack
# go.opencensus.io => go.opencensus.io v0.20.2