From fc752631119f3204a7dc7e58dfc83c91ff997632 Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Mon, 23 Aug 2021 09:07:21 -0700 Subject: [PATCH] Add CE Client to dynamic injection I noticed log statements experimenting with using the dynamic injection logic with Tekton. Since it seems like the CE stuff is just piggybacking on injection (and not actually using the `rest.Config`) this should be a pretty trivial/benign change. --- pkg/reconciler/events/cloudevent/cloudeventclient.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/reconciler/events/cloudevent/cloudeventclient.go b/pkg/reconciler/events/cloudevent/cloudeventclient.go index d191d972471..8305bb34fb6 100644 --- a/pkg/reconciler/events/cloudevent/cloudeventclient.go +++ b/pkg/reconciler/events/cloudevent/cloudeventclient.go @@ -27,13 +27,16 @@ import ( ) func init() { - injection.Default.RegisterClient(withCloudEventClient) + injection.Default.RegisterClient(func(ctx context.Context, _ *rest.Config) context.Context { + return withCloudEventClient(ctx) + }) + injection.Dynamic.RegisterDynamicClient(withCloudEventClient) } // CECKey is used to associate the CloudEventClient inside the context.Context type CECKey struct{} -func withCloudEventClient(ctx context.Context, cfg *rest.Config) context.Context { +func withCloudEventClient(ctx context.Context) context.Context { logger := logging.FromContext(ctx) // When KeepAlive is enabled the connections are not reused - see