upgrade to latest dependencies (#3074)

Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
knative-automation 2020-12-08 07:14:41 -08:00 committed by GitHub
parent a3d418dcd3
commit b9dfccfdd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 190 additions and 20 deletions

4
go.mod
View File

@ -17,8 +17,8 @@ require (
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/go-playground/webhooks.v3 v3.13.0
gopkg.in/yaml.v2 v2.3.0
knative.dev/hack v0.0.0-20201120192952-353db687ec5b
knative.dev/net-istio v0.19.1-0.20201121020252-76ca6614fd8c
knative.dev/hack v0.0.0-20201201234937-fddbf732e450
knative.dev/net-istio v0.19.1-0.20201208034941-e87b1c73e380
)
replace go.opencensus.io => go.opencensus.io v0.20.2

17
go.sum
View File

@ -94,6 +94,7 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc=
github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b/go.mod h1:ac9efd0D1fsDb3EJvhqgXRbFx7bs2wqZ10HQPeU8U/Q=
github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M=
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
@ -1035,16 +1036,12 @@ k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C
k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU=
k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
knative.dev/hack v0.0.0-20201118155651-b31d3bb6bff9/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20201119025252-d3cb354f49ff/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20201119155951-11aa26c8eaf6/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20201120192952-353db687ec5b h1:Lc+AKgwhAZUD98mN++qTHeeaP6FRmS8fcwc/rXkP8G0=
knative.dev/hack v0.0.0-20201120192952-353db687ec5b/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/net-istio v0.19.1-0.20201121020252-76ca6614fd8c h1:p/WWMcTNjIoEBAWw0pLAnTf5i24Eg21KpQKTj3rop9c=
knative.dev/net-istio v0.19.1-0.20201121020252-76ca6614fd8c/go.mod h1:5cjBInwseXZ7RsigrU/nxzPmgIMw3O7xPR9DOOPkQrw=
knative.dev/networking v0.0.0-20201119153452-ac0823abbb90/go.mod h1:nSQJwxjDMbJ2/XxzJ2KR8bg6lf6RjzH7M+3Im1T51z0=
knative.dev/pkg v0.0.0-20201119021551-260026d54739/go.mod h1:3Udj7GogdjFg0M05MJm+aJjHx1BK/tyQarl5RB2k0Xo=
knative.dev/pkg v0.0.0-20201119170152-e5e30edc364a/go.mod h1:qv0lAVIPd4AmEsLyOOU6hzaN++wfBG+skRqtdcg0h7M=
knative.dev/hack v0.0.0-20201201234937-fddbf732e450 h1:IyitWF7OzfunCgE4b9ZsJAeIRoQ6JOyqDrz/19X4iS4=
knative.dev/hack v0.0.0-20201201234937-fddbf732e450/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/net-istio v0.19.1-0.20201208034941-e87b1c73e380 h1:fGIS3piik/gSTljmv1vTrmJ6LA9jJaY4uBUXUI4zWCg=
knative.dev/net-istio v0.19.1-0.20201208034941-e87b1c73e380/go.mod h1:iIE64H+X9ktdYWZnucg+ere6DchW/YtpcN6kkz5V6X8=
knative.dev/networking v0.0.0-20201208014140-4d1d53eb0626/go.mod h1:V4CU4mLLkWboLw3NOVmPHHOCL5nrUO3/vsRDUjsnJUQ=
knative.dev/pkg v0.0.0-20201207225040-7e918163fc4f/go.mod h1:Jtbz2/1gB8EZgZA4VvabTxM+AcDt2WL2P0RaFnKcOX8=
pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
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=

View File

@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Copyright 2020 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Setup the env for doing Knative style codegen.
kn_hack_library=${kn_hack_library:-"$(dirname $0)/../vendor/knative.dev/hack/library.sh"}
if [[ -f "$kn_hack_library" ]]; then
source $kn_hack_library
else
echo "this file is intended to be imported from a golang project that vendors knative.dev/hack"
exit
fi
export GOPATH=$(go_mod_gopath_hack)
export MODULE_NAME=$(go_mod_module_name)
export CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}
export KNATIVE_CODEGEN_PKG=${KNATIVE_CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 ./vendor/knative.dev/pkg 2>/dev/null || echo ../pkg)}
chmod +x ${CODEGEN_PKG}/generate-groups.sh
chmod +x ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh

View File

@ -98,6 +98,37 @@ function function_exists() {
[[ "$(type -t $1)" == "function" ]]
}
# GitHub Actions aware output grouping.
function group() {
# End the group is there is already a group.
if [ -z ${__GROUP_TRACKER+x} ]; then
export __GROUP_TRACKER="grouping"
trap end_group EXIT
else
end_group
fi
# Start a new group.
start_group "$@"
}
# GitHub Actions aware output grouping.
function start_group() {
if [[ -n ${GITHUB_WORKFLOW:-} ]]; then
echo "::group::$@"
trap end_group EXIT
else
echo "--- $@"
fi
}
# GitHub Actions aware end of output grouping.
function end_group() {
if [[ -n ${GITHUB_WORKFLOW:-} ]]; then
echo "::endgroup::"
fi
}
# Waits until the given object doesn't exist.
# Parameters: $1 - the kind of the object.
# $2 - object's name.
@ -528,7 +559,7 @@ function go_update_deps() {
done
if [[ $UPGRADE == 1 ]]; then
echo "--- Upgrading to ${VERSION}"
group "Upgrading to ${VERSION}"
# From shell parameter expansion:
# ${parameter:+word}
# If parameter is null or unset, nothing is substituted, otherwise the expansion of word is substituted.
@ -548,7 +579,7 @@ function go_update_deps() {
fi
fi
echo "--- Go mod tidy and vendor"
group "Go mod tidy and vendor"
# Prune modules.
local orig_pipefail_opt=$(shopt -p -o pipefail)
@ -557,7 +588,7 @@ function go_update_deps() {
go mod vendor 2>&1 | grep -v "ignoring symlink" || true
eval "$orig_pipefail_opt"
echo "--- Removing unwanted vendor files"
group "Removing unwanted vendor files"
# Remove unwanted vendor files
find vendor/ \( -name "OWNERS" \
@ -568,13 +599,32 @@ function go_update_deps() {
export GOFLAGS=-mod=vendor
echo "--- Updating licenses"
group "Updating licenses"
update_licenses third_party/VENDOR-LICENSE "./..."
echo "--- Removing broken symlinks"
group "Removing broken symlinks"
remove_broken_symlinks ./vendor
}
# Return the go module name of the current module.
# Intended to be used like:
# export MODULE_NAME=$(go_mod_module_name)
function go_mod_module_name() {
go mod graph | cut -d' ' -f 1 | grep -v '@' | head -1
}
# Return a GOPATH to a temp directory. Works around the out-of-GOPATH issues
# for k8s client gen mixed with go mod.
# Intended to be used like:
# export GOPATH=$(go_mod_gopath_hack)
function go_mod_gopath_hack() {
local TMP_DIR="$(mktemp -d)"
local TMP_REPO_PATH="${TMP_DIR}/src/$(go_mod_module_name)"
mkdir -p "$(dirname "${TMP_REPO_PATH}")" && ln -s "${REPO_ROOT_DIR}" "${TMP_REPO_PATH}"
echo "${TMP_DIR}"
}
# Run kntest tool, error out and ask users to install it if it's not currently installed.
# Parameters: $1..$n - parameters passed to the tool.
function run_kntest() {

View File

@ -0,0 +1,89 @@
#!/usr/bin/env bash
# Copyright 2019 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -count argument when running go test
readonly BENCH_RUN_COUNT=${BENCH_RUN_COUNT:-5}
# -benchtime argument when running go test
readonly BENCH_RUN_TIME=${BENCH_RUN_TIME:-5s}
function microbenchmarks_run() {
if [ "$1" != "" ]; then
OUTPUT_FILE="$1"
else
OUTPUT_FILE="${ARTIFACTS:-$(mktemp -d)}/bench-result.txt"
fi
# Run all microbenchmarks
go clean
go test -bench=. -benchtime=$BENCH_RUN_TIME -count=$BENCH_RUN_COUNT -benchmem -run="^$" -v ./... >> "$OUTPUT_FILE" || exit
}
# To run microbenchmarks on your machine and compare your revision with upstream/master:
#
# git fetch upstream
# source microbenchmarks.sh
# microbenchmarks_run_and_compare upstream/master
#
# NOTE: Hypothetically we should run these microbenchmarks on a machine running only a kernel and a shell,
# but this might be sometimes hard to achieve unless you have a spare computer to play with.
# When running microbenchmarks on your dev machine, make sure you have the bare minimum applications running on your laptop,
# otherwise you'll get a variance too high.
# Close Slack, the browser, the IDE, stop Docker, stop Netflix and grab a coffee while waiting for the results.
# Depending on the benchmark complexity/reproducibility, if the variance is too high, repeat the benchmarks.
function microbenchmarks_run_and_compare() {
if [ "$1" == "" ] || [ $# -gt 1 ]; then
echo "Error: Expecting an argument" >&2
echo "usage: $(basename $0) revision_to_compare" >&2
exit 1
fi
if [ "$2" == "" ]; then
OUTPUT_DIR=${ARTIFACTS:-$(mktemp -d)}
else
OUTPUT_DIR="$2"
fi
mkdir -p "$OUTPUT_DIR"
# Benchstat is required to compare the bench results
GO111MODULE=off go get golang.org/x/perf/cmd/benchstat
# Revision to use to compare with actual
REVISION="$1"
echo "--- Outputs will be at $OUTPUT_DIR"
# Run this revision benchmarks
microbenchmarks_run "$OUTPUT_DIR/new.txt"
echo "--- This revision results:"
cat "$OUTPUT_DIR/new.txt"
# Run other revision benchmarks
git checkout "$REVISION"
microbenchmarks_run "$OUTPUT_DIR/old.txt"
echo "--- $REVISION results:"
cat "$OUTPUT_DIR/old.txt"
# Print results in console
echo "--- Benchstat:"
benchstat "$OUTPUT_DIR/old.txt" "$OUTPUT_DIR/new.txt"
# Generate html results
benchstat -html "$OUTPUT_DIR/old.txt" "$OUTPUT_DIR/new.txt" >> "$OUTPUT_DIR/results.html"
}

View File

@ -23,7 +23,7 @@ case "${OSTYPE}" in
esac
# Download and unpack Istio
ISTIO_VERSION=1.7.1
ISTIO_VERSION=1.7.5
ISTIO_TARBALL=istio-${ISTIO_VERSION}-${ARCH}.tar.gz
DOWNLOAD_URL=https://github.com/istio/istio/releases/download/${ISTIO_VERSION}/${ISTIO_TARBALL}
SYSTEM_NAMESPACE="${SYSTEM_NAMESPACE:-"knative-serving"}"

4
vendor/modules.txt vendored
View File

@ -265,10 +265,10 @@ gopkg.in/go-playground/webhooks.v3/github
# gopkg.in/yaml.v2 v2.3.0
## explicit
gopkg.in/yaml.v2
# knative.dev/hack v0.0.0-20201120192952-353db687ec5b
# knative.dev/hack v0.0.0-20201201234937-fddbf732e450
## explicit
knative.dev/hack
# knative.dev/net-istio v0.19.1-0.20201121020252-76ca6614fd8c
# knative.dev/net-istio v0.19.1-0.20201208034941-e87b1c73e380
## explicit
knative.dev/net-istio/third_party/istio-stable
# go.opencensus.io => go.opencensus.io v0.20.2