upgrade to latest dependencies (#461)

bumping knative.dev/pkg 2a0fc65...cfc1eed:
  > cfc1eed Better support for error wrapping with ReconcilerEvents (# 2106)

Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
knative-automation 2021-04-26 20:08:50 -07:00 committed by GitHub
parent 0643a27080
commit dfd51be034
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 17 deletions

2
go.mod
View File

@ -19,5 +19,5 @@ require (
k8s.io/code-generator v0.19.7
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6
knative.dev/hack v0.0.0-20210426064739-88c69cd1eca7
knative.dev/pkg v0.0.0-20210426101439-2a0fc657a712
knative.dev/pkg v0.0.0-20210426180040-cfc1eed82870
)

4
go.sum
View File

@ -1222,8 +1222,8 @@ knative.dev/hack v0.0.0-20210325223819-b6ab329907d3 h1:km0Rrh0T9/wA2pivQm1hqSPVw
knative.dev/hack v0.0.0-20210325223819-b6ab329907d3/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20210426064739-88c69cd1eca7 h1:Z5icQ2KNCDSzTcHWMGI3KzdK/BpmgkGYdTX0RRzZul0=
knative.dev/hack v0.0.0-20210426064739-88c69cd1eca7/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/pkg v0.0.0-20210426101439-2a0fc657a712 h1:cOCsX7V1QRubJdUqWW/yeD+5Pok6smz0chUq5Vi4Aq4=
knative.dev/pkg v0.0.0-20210426101439-2a0fc657a712/go.mod h1:UtcSLHy2XIz5blWoPTA40F87zk4O7erxkCwv+7Tsmws=
knative.dev/pkg v0.0.0-20210426180040-cfc1eed82870 h1:22gVDwcYqqZDGJOEBTBCthJH88dyTSLokOWlz1E9GIg=
knative.dev/pkg v0.0.0-20210426180040-cfc1eed82870/go.mod h1:UtcSLHy2XIz5blWoPTA40F87zk4O7erxkCwv+7Tsmws=
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

@ -296,7 +296,7 @@ func (r *reconcilerImpl) Reconcile(ctx context.Context, key string) error {
var event *reconciler.ReconcilerEvent
if reconciler.EventAs(reconcileEvent, &event) {
logger.Infow("Returned an event", zap.Any("event", reconcileEvent))
r.Recorder.Eventf(resource, event.EventType, event.Reason, event.Format, event.Args...)
r.Recorder.Event(resource, event.EventType, event.Reason, event.Error())
// the event was wrapped inside an error, consider the reconciliation as failed
if _, isEvent := reconcileEvent.(*reconciler.ReconcilerEvent); !isEvent {

View File

@ -508,7 +508,7 @@ func (r *reconcilerImpl) Reconcile(ctx {{.contextContext|raw}}, key string) erro
var event *{{.reconcilerReconcilerEvent|raw}}
if reconciler.EventAs(reconcileEvent, &event) {
logger.Infow("Returned an event", zap.Any("event", reconcileEvent))
r.Recorder.Eventf(resource, event.EventType, event.Reason, event.Format, event.Args...)
r.Recorder.Event(resource, event.EventType, event.Reason, event.Error())
// the event was wrapped inside an error, consider the reconciliation as failed
if _, isEvent := reconcileEvent.(*reconciler.ReconcilerEvent); !isEvent {

View File

@ -18,23 +18,20 @@ set -o errexit
set -o nounset
set -o pipefail
export GO111MODULE=on
source $(dirname $0)/../vendor/knative.dev/hack/codegen-library.sh
# If we run with -mod=vendor here, then generate-groups.sh looks for vendor files in the wrong place.
export GOFLAGS=-mod=
if [ -z "${GOPATH:-}" ]; then
export GOPATH=$(go env GOPATH)
fi
source $(dirname $0)/../vendor/knative.dev/hack/library.sh
CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 $(dirname $0)/../vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}
echo "=== Update Codegen for $MODULE_NAME"
# generate the code with:
# --output-base because this script should also be able to run inside the vendor dir of
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
group "Kubernetes Codegen"
# Knative Injection
${REPO_ROOT_DIR}/hack/generate-knative.sh "injection" \
knative.dev/pkg/client knative.dev/pkg/apis \
@ -60,8 +57,9 @@ VERSIONED_CLIENTSET_PKG="k8s.io/apiextensions-apiserver/pkg/client/clientset/cli
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt \
--force-genreconciler-kinds "CustomResourceDefinition"
group "Knative Codegen"
# Only deepcopy the Duck types, as they are not real resources.
chmod +x ${CODEGEN_PKG}/generate-groups.sh
${CODEGEN_PKG}/generate-groups.sh "deepcopy" \
knative.dev/pkg/client knative.dev/pkg/apis \
"duck:v1alpha1,v1beta1,v1" \
@ -81,6 +79,7 @@ go run k8s.io/code-generator/cmd/deepcopy-gen --input-dirs \
-O zz_generated.deepcopy \
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt
group "Update deps post-codegen"
# Make sure our dependencies are up-to-date
${REPO_ROOT_DIR}/hack/update-deps.sh

View File

@ -96,5 +96,5 @@ func (e *ReconcilerEvent) As(target interface{}) bool {
// Error returns the string that is formed by using the format string with the
// provided args.
func (e *ReconcilerEvent) Error() string {
return fmt.Sprintf(e.Format, e.Args...)
return fmt.Errorf(e.Format, e.Args...).Error()
}

2
vendor/modules.txt vendored
View File

@ -665,7 +665,7 @@ k8s.io/utils/trace
# knative.dev/hack v0.0.0-20210426064739-88c69cd1eca7
## explicit
knative.dev/hack
# knative.dev/pkg v0.0.0-20210426101439-2a0fc657a712
# knative.dev/pkg v0.0.0-20210426180040-cfc1eed82870
## explicit
knative.dev/pkg/apis
knative.dev/pkg/apis/duck