Skip to content

Commit

Permalink
upgrade to latest dependencies (knative#13147)
Browse files Browse the repository at this point in the history
bumping knative.dev/networking 1f4c9ce...cddb0ff:
  > cddb0ff Stop using knative.dev/pkg/pool, use errgroup instead (# 695)
bumping knative.dev/hack a645040...782bbaa:
  > 782bbaa drop warning (# 204)
  > 92c7e36 Fix the buoy invocation (# 203)
  > 123a278 🧹 Migrate to using the `go run` instead of `go install` (# 172)
bumping knative.dev/pkg 3764d73...6c9c1c6:
  > 6c9c1c6 remove defunct markdown linting variable (# 2552)
bumping golang.org/x/sync 0de741c...886fb93:
  > 886fb93 A+C: delete AUTHORS and CONTRIBUTORS
bumping knative.dev/caching 9d082ff...783e336:
  > 783e336 upgrade to latest dependencies (# 661)

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation authored Jul 25, 2022
1 parent 808923d commit 2a22c44
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 79 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
go.uber.org/zap v1.19.1
golang.org/x/net v0.0.0-20220225172249-27dd8689420f
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65
google.golang.org/api v0.70.0
google.golang.org/grpc v1.44.0
Expand All @@ -31,11 +31,11 @@ require (
k8s.io/client-go v0.23.8
k8s.io/code-generator v0.23.8
k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf
knative.dev/caching v0.0.0-20220721132919-9d082ff35e00
knative.dev/caching v0.0.0-20220725105524-783e3361b29b
knative.dev/control-protocol v0.0.0-20220711013913-b5a214695a24
knative.dev/hack v0.0.0-20220721014222-a6450400b5f1
knative.dev/networking v0.0.0-20220722153221-1f4c9ce38742
knative.dev/pkg v0.0.0-20220722152821-3764d73bf97e
knative.dev/hack v0.0.0-20220725145124-782bbaabb8a1
knative.dev/networking v0.0.0-20220723000421-cddb0ff95789
knative.dev/pkg v0.0.0-20220722175921-6c9c1c6098d5
sigs.k8s.io/yaml v1.3.0
)

Expand Down
21 changes: 11 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1646,8 +1646,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -2246,19 +2246,20 @@ k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc=
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
knative.dev/caching v0.0.0-20220721132919-9d082ff35e00 h1:0RasQl+drKVA/BEb+JGhXCzZqI6+nR7HSn1j3w1ePy8=
knative.dev/caching v0.0.0-20220721132919-9d082ff35e00/go.mod h1:Z/PxBzBrPhisXQhUbeoHCGWcyWyEsBlNqhct03hFpC4=
knative.dev/caching v0.0.0-20220725105524-783e3361b29b h1:Or9sS/n+qBroHPDQTigzlbWZ79afi4Tf5s+e8AAD710=
knative.dev/caching v0.0.0-20220725105524-783e3361b29b/go.mod h1:Mlgy6XAtPHXR7nkmltDfA24GVeTPG8o6mL3aUHCICss=
knative.dev/control-protocol v0.0.0-20220711013913-b5a214695a24 h1:jV37MfeOYY/8FUNrGOlqwNOU7Ttvd24SpjcrVX4w8Qk=
knative.dev/control-protocol v0.0.0-20220711013913-b5a214695a24/go.mod h1:yKqKLbEEsVfwE7eEladw/1bqk8+Ai+6sghLGpWtjK90=
knative.dev/hack v0.0.0-20220701014203-65c463ac8c98/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20220721014222-a6450400b5f1 h1:t6jYBtJwVhyx+48cidFj1ckYAlMesS0yCnAlW2BJyNo=
knative.dev/hack v0.0.0-20220721014222-a6450400b5f1/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/networking v0.0.0-20220722153221-1f4c9ce38742 h1:XG/qnndH7DiqqA35ocQLhi91n3cMTRoD26E+Pzy5+fg=
knative.dev/networking v0.0.0-20220722153221-1f4c9ce38742/go.mod h1:Z+EvJIWmVXA/qQjq4xRMtCjhVgyxw43y/hvkIb//bTc=
knative.dev/hack v0.0.0-20220722185521-123a2783c4d8/go.mod h1:t/azP8I/Cygaw+87O7rkAPrNRjCelmtfSzWzu/9TM7I=
knative.dev/hack v0.0.0-20220725145124-782bbaabb8a1 h1:90z6q68YSEUuPR5P5j8W6viTO8Pi/MhNnHEIhX3Uvnk=
knative.dev/hack v0.0.0-20220725145124-782bbaabb8a1/go.mod h1:t/azP8I/Cygaw+87O7rkAPrNRjCelmtfSzWzu/9TM7I=
knative.dev/networking v0.0.0-20220723000421-cddb0ff95789 h1:utP79FgVXwef+5j9EL2YKD6HcvKvB1pbR19T6hG4+a0=
knative.dev/networking v0.0.0-20220723000421-cddb0ff95789/go.mod h1:YvQyPygj2RYH2WpY+2wbCmE75bOwElPIkr773zEkh4Y=
knative.dev/pkg v0.0.0-20220705130606-e60d250dc637/go.mod h1:MxsV3ZGdrH87zv4O9HtxzbNwmiKcGwEP7UdriLINSn0=
knative.dev/pkg v0.0.0-20220721014205-1a5e1682be3a/go.mod h1:eMXp/bEI/o1rKbNjTgifcQsI//e/3pfk0SMLu38Q3Sk=
knative.dev/pkg v0.0.0-20220722152821-3764d73bf97e h1:Nz5HXF4XAI/afYGMGG5JyDSKUS7vUEH5kKLu8/fmvuk=
knative.dev/pkg v0.0.0-20220722152821-3764d73bf97e/go.mod h1:zaGmg6so9RiTx8Fu6vCSUClfVtOBtCrsD/j3c2y+no8=
knative.dev/pkg v0.0.0-20220722175921-6c9c1c6098d5 h1:wfxvM/LiVcnHxZCOeBQwFcjJxIGIhhNglK0uj3dwmms=
knative.dev/pkg v0.0.0-20220722175921-6c9c1c6098d5/go.mod h1:zaGmg6so9RiTx8Fu6vCSUClfVtOBtCrsD/j3c2y+no8=
knative.dev/reconciler-test v0.0.0-20220705155206-f05db88effbe/go.mod h1:ujEp+LOo2TJUM/RXBqlirvyesuLAJg3rr3iuCOBINGQ=
mvdan.cc/gofumpt v0.1.1/go.mod h1:yXG1r1WqZVKWbVRtBWKWX9+CxGYfA51nSomhM0woR48=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
Expand Down
3 changes: 0 additions & 3 deletions vendor/golang.org/x/sync/AUTHORS

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/golang.org/x/sync/CONTRIBUTORS

This file was deleted.

2 changes: 1 addition & 1 deletion vendor/knative.dev/hack/infra-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# This is a collection of functions for infra related setups, mainly
# cluster provisioning. It doesn't do anything when called from command line.

source $(dirname "${BASH_SOURCE[0]}")/library.sh
source "$(dirname "${BASH_SOURCE[0]:-$0}")/library.sh"

# Dumps the k8s api server metrics. Spins up a proxy, waits a little bit and
# dumps the metrics to ${ARTIFACTS}/k8s.metrics.txt
Expand Down
110 changes: 66 additions & 44 deletions vendor/knative.dev/hack/library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fi
readonly IS_PROW
[[ ! -v REPO_ROOT_DIR ]] && REPO_ROOT_DIR="$(git rev-parse --show-toplevel)"
readonly REPO_ROOT_DIR
readonly REPO_NAME="$(basename ${REPO_ROOT_DIR})"
readonly REPO_NAME="${REPO_NAME:-$(basename "${REPO_ROOT_DIR}")}"

# Useful flags about the current OS
IS_LINUX=0
Expand All @@ -56,10 +56,15 @@ readonly IS_LINUX
readonly IS_OSX
readonly IS_WINDOWS

export TMPDIR="${TMPDIR:-$(mktemp -u -t -d knative.XXXXXXXX)}"
mkdir -p "$TMPDIR"
# Set ARTIFACTS to an empty temp dir if unset
if [[ -z "${ARTIFACTS:-}" ]]; then
export ARTIFACTS="$(mktemp -d)"
ARTIFACTS="$(mktemp -u -t -d)"
export ARTIFACTS
fi
mkdir -p "$ARTIFACTS"


# On a Prow job, redirect stderr to stdout so it's synchronously added to log
(( IS_PROW )) && exec 2>&1
Expand Down Expand Up @@ -429,45 +434,46 @@ function mktemp_with_extension() {
function create_junit_xml() {
local xml
xml="$(mktemp_with_extension "${ARTIFACTS}"/junit_XXXXXXXX xml)"
echo "JUnit file ${xml} is created for reporting the test result"
echo "XML report for $1::$2 written to ${xml}"
run_kntest junit --suite="$1" --name="$2" --err-msg="$3" --dest="${xml}" || return 1
}

# Runs a go test and generate a junit summary.
# Parameters: $1... - parameters to go test
function report_go_test() {
local go_test_args=( "$@" )
# Install gotestsum if necessary.
run_go_tool gotest.tools/gotestsum gotestsum --help > /dev/null 2>&1
# Capture the test output to the report file.
local report
report="$(mktemp)"
local xml
local logfile xml ansilog htmllog
xml="$(mktemp_with_extension "${ARTIFACTS}"/junit_XXXXXXXX xml)"
# Keep the suffix, so files are related.
logfile="${xml/junit_/go_test_}"
logfile="${logfile/.xml/.jsonl}"
echo "Running go test with args: ${go_test_args[*]}"
capture_output "${report}" gotestsum --format "${GO_TEST_VERBOSITY:-testname}" \
--junitfile "${xml}" --junitfile-testsuite-name relative --junitfile-testcase-classname relative \
go_run gotest.tools/[email protected] \
--format "${GO_TEST_VERBOSITY:-testname}" \
--junitfile "${xml}" \
--junitfile-testsuite-name relative \
--junitfile-testcase-classname relative \
--jsonfile "${logfile}" \
-- "${go_test_args[@]}"
local failed=$?
echo "Finished run, return code is ${failed}"
local gotest_retcode=$?
echo "Finished run, return code is ${gotest_retcode}"

echo "XML report written to ${xml}"
if [[ -n "$(grep '<testsuites></testsuites>' "${xml}")" ]]; then
# XML report is empty, something's wrong; use the output as failure reason
create_junit_xml _go_tests "GoTests" "$(cat "${report}")"
fi
# Capture and report any race condition errors
local race_errors
race_errors="$(sed -n '/^WARNING: DATA RACE$/,/^==================$/p' "${report}")"
create_junit_xml _go_tests "DataRaceAnalysis" "${race_errors}"
if (( ! IS_PROW )); then
# Keep the suffix, so files are related.
local logfile=${xml/junit_/go_test_}
logfile=${logfile/.xml/.log}
cp "${report}" "${logfile}"
echo "Test log written to ${logfile}"
fi
return ${failed}
echo "Test log (JSONL) written to ${logfile}"

ansilog="${logfile/.jsonl/-ansi.log}"
go_run github.com/haveyoudebuggedit/gotestfmt/v2/cmd/[email protected] \
-input "${logfile}" \
-showteststatus \
-nofail > "$ansilog"
echo "Test log (ANSI) written to ${ansilog}"

htmllog="${logfile/.jsonl/.html}"
go_run github.com/buildkite/terminal-to-html/v3/cmd/[email protected] \
--preview < "$ansilog" > "$htmllog"
echo "Test log (HTML) written to ${htmllog}"

return ${gotest_retcode}
}

# Install Knative Serving in the current cluster.
Expand Down Expand Up @@ -543,24 +549,41 @@ function start_latest_eventing_sugar_controller() {
start_knative_eventing_extension "${KNATIVE_EVENTING_SUGAR_CONTROLLER_RELEASE}" "knative-eventing"
}

# Run a go utility without installing it.
# Parameters: $1 - tool package for go run.
# $2..$n - parameters passed to the tool.
function go_run() {
local package
package="$1"
if [[ "$package" != *@* ]]; then
abort 'Package for "go_run" needs to have @version'
fi
shift 1
GORUN_PATH="${GORUN_PATH:-$(go env GOPATH)}"
# Some CI environments may have non-writable GOPATH
if ! [ -w "${GORUN_PATH}" ]; then
GORUN_PATH="$(mktemp -t -d -u gopath.XXXXXXXX)"
fi
export GORUN_PATH
GOPATH="${GORUN_PATH}" \
GOFLAGS='' \
GO111MODULE='' \
go run "$package" "$@"
}

# Run a go tool, installing it first if necessary.
# Parameters: $1 - tool package/dir for go install.
# $2 - tool to run.
# $3..$n - parameters passed to the tool.
# Deprecated: use go_run instead
function run_go_tool() {
local package=$1
local tool=$2
local install_failed=0
# If no `@version` is provided, default to adding `@latest`
if [[ "$package" != *@* ]]; then
package=$package@latest
fi
if [[ -z "$(which ${tool})" ]]; then
GOFLAGS="" go install "$package" || install_failed=1
fi
(( install_failed )) && return ${install_failed}
shift 2
${tool} "$@"
go_run "$package" "$@"
}

# Add function call to trap
Expand Down Expand Up @@ -623,7 +646,7 @@ function go_update_deps() {
else
group "Upgrading to release ${RELEASE}"
fi
FLOATING_DEPS+=( $(run_go_tool knative.dev/test-infra/buoy buoy float ${REPO_ROOT_DIR}/go.mod "${buoyArgs[@]}") )
FLOATING_DEPS+=( $(go_run knative.dev/test-infra/buoy@latest float ${REPO_ROOT_DIR}/go.mod "${buoyArgs[@]}") )
if [[ ${#FLOATING_DEPS[@]} > 0 ]]; then
echo "Floating deps to ${FLOATING_DEPS[@]}"
go get -d ${FLOATING_DEPS[@]}
Expand Down Expand Up @@ -684,13 +707,10 @@ function go_mod_gopath_hack() {
echo "${TMP_DIR}"
}

# Run kntest tool, error out and ask users to install it if it's not currently installed.
# Run kntest tool
# Parameters: $1..$n - parameters passed to the tool.
function run_kntest() {
if [[ ! -x "$(command -v kntest)" ]]; then
echo "--- FAIL: kntest not installed, please clone knative test-infra repo and run \`go install ./tools/kntest/cmd/kntest\` to install it"; return 1;
fi
kntest "$@"
go_run knative.dev/test-infra/tools/kntest/cmd/kntest@latest "$@"
}

# Run go-licenses to update licenses.
Expand All @@ -701,14 +721,16 @@ function update_licenses() {
local dst=$1
local dir=$2
shift
run_go_tool github.com/google/go-licenses go-licenses save "${dir}" --save_path="${dst}" --force || \
go_run github.com/google/[email protected] \
save "${dir}" --save_path="${dst}" --force || \
{ echo "--- FAIL: go-licenses failed to update licenses"; return 1; }
}

# Run go-licenses to check for forbidden licenses.
function check_licenses() {
# Check that we don't have any forbidden licenses.
run_go_tool github.com/google/go-licenses go-licenses check "${REPO_ROOT_DIR}/..." || \
go_run github.com/google/[email protected] \
check "${REPO_ROOT_DIR}/..." || \
{ echo "--- FAIL: go-licenses failed the license check"; return 1; }
}

Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/hack/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function run_unit_tests() {

# Default unit test runner that runs all go tests in the repo.
function default_unit_test_runner() {
report_go_test -race -count 1 ./...
report_go_test -short -race -count 1 ./...
}

# Run integration tests. If there's no `integration_tests` function, run the
Expand Down
3 changes: 1 addition & 2 deletions vendor/knative.dev/hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# See README.md for instructions on how to use it.

source $(dirname "${BASH_SOURCE[0]}")/library.sh
set -x

# Organization name in GitHub; defaults to Knative.
readonly ORG_NAME="${ORG_NAME:-knative}"
Expand Down Expand Up @@ -108,7 +107,7 @@ export GITHUB_TOKEN=""
# Convenience function to run the hub tool.
# Parameters: $1..$n - arguments to hub.
function hub_tool() {
run_go_tool github.com/github/hub hub $@
gorun github.com/github/hub@v2.14.2 "$@"
}

# Shortcut to "git push" that handles authentication.
Expand Down
4 changes: 0 additions & 4 deletions vendor/knative.dev/pkg/test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
# It is started by prow for each PR.
# For convenience, it can also be executed manually.

# Markdown linting failures don't show up properly in Gubernator resulting
# in a net-negative contributor experience.
export DISABLE_MD_LINTING=1

export GO111MODULE=on

source $(dirname $0)/../vendor/knative.dev/hack/presubmit-tests.sh
Expand Down
12 changes: 6 additions & 6 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ golang.org/x/oauth2/google/internal/externalaccount
golang.org/x/oauth2/internal
golang.org/x/oauth2/jws
golang.org/x/oauth2/jwt
# golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f
# golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
## explicit
golang.org/x/sync/errgroup
golang.org/x/sync/semaphore
Expand Down Expand Up @@ -1177,7 +1177,7 @@ k8s.io/utils/lru
k8s.io/utils/net
k8s.io/utils/pointer
k8s.io/utils/trace
# knative.dev/caching v0.0.0-20220721132919-9d082ff35e00
# knative.dev/caching v0.0.0-20220725105524-783e3361b29b
## explicit; go 1.15
knative.dev/caching/config
knative.dev/caching/pkg/apis/caching
Expand All @@ -1202,11 +1202,11 @@ knative.dev/caching/pkg/client/listers/caching/v1alpha1
## explicit; go 1.17
knative.dev/control-protocol/pkg/certificates
knative.dev/control-protocol/pkg/certificates/reconciler
# knative.dev/hack v0.0.0-20220721014222-a6450400b5f1
## explicit; go 1.14
# knative.dev/hack v0.0.0-20220725145124-782bbaabb8a1
## explicit; go 1.17
knative.dev/hack
knative.dev/hack/shell
# knative.dev/networking v0.0.0-20220722153221-1f4c9ce38742
# knative.dev/networking v0.0.0-20220723000421-cddb0ff95789
## explicit; go 1.17
knative.dev/networking/config
knative.dev/networking/pkg
Expand Down Expand Up @@ -1243,7 +1243,7 @@ knative.dev/networking/pkg/http/stats
knative.dev/networking/pkg/ingress
knative.dev/networking/pkg/k8s
knative.dev/networking/pkg/prober
# knative.dev/pkg v0.0.0-20220722152821-3764d73bf97e
# knative.dev/pkg v0.0.0-20220722175921-6c9c1c6098d5
## explicit; go 1.18
knative.dev/pkg/apiextensions/storageversion
knative.dev/pkg/apiextensions/storageversion/cmd/migrate
Expand Down

0 comments on commit 2a22c44

Please sign in to comment.