diff --git a/go.mod b/go.mod index 5d151af1..723100ac 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index 1a0f2344..fc6a4bc6 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/pkg/client/injection/reconciler/caching/v1alpha1/image/reconciler.go b/pkg/client/injection/reconciler/caching/v1alpha1/image/reconciler.go index 9962fd53..842c2cff 100644 --- a/pkg/client/injection/reconciler/caching/v1alpha1/image/reconciler.go +++ b/pkg/client/injection/reconciler/caching/v1alpha1/image/reconciler.go @@ -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 { diff --git a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/reconciler_reconciler.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/reconciler_reconciler.go index e239bf64..15fb4259 100644 --- a/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/reconciler_reconciler.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/reconciler_reconciler.go @@ -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 { diff --git a/vendor/knative.dev/pkg/hack/update-codegen.sh b/vendor/knative.dev/pkg/hack/update-codegen.sh index 5f6df7e2..a8051e6d 100644 --- a/vendor/knative.dev/pkg/hack/update-codegen.sh +++ b/vendor/knative.dev/pkg/hack/update-codegen.sh @@ -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 - diff --git a/vendor/knative.dev/pkg/reconciler/events.go b/vendor/knative.dev/pkg/reconciler/events.go index ecad3a0f..4c85c884 100644 --- a/vendor/knative.dev/pkg/reconciler/events.go +++ b/vendor/knative.dev/pkg/reconciler/events.go @@ -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() } diff --git a/vendor/modules.txt b/vendor/modules.txt index 29764852..a66780a9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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