Skip to content

Commit

Permalink
Add CE Client to dynamic injection
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mattmoor authored and tekton-robot committed Aug 24, 2021
1 parent e38b267 commit 7297c48
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/reconciler/events/cloudevent/cloudeventclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7297c48

Please sign in to comment.