From 7f935b147355a87e20e5073ee445cef6eb60f1ab Mon Sep 17 00:00:00 2001 From: Calum Murray Date: Thu, 12 Oct 2023 11:39:37 -0400 Subject: [PATCH] Added kubeclient to context for new adapter creation Signed-off-by: Calum Murray --- pkg/source/mtadapter/adapter.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/source/mtadapter/adapter.go b/pkg/source/mtadapter/adapter.go index 1b5a185dbe..17d993bf05 100644 --- a/pkg/source/mtadapter/adapter.go +++ b/pkg/source/mtadapter/adapter.go @@ -198,7 +198,9 @@ func (a *Adapter) Update(ctx context.Context, obj *v1beta1.KafkaSource) error { URL: sinkURI, } - adapter := a.adapterCtor(ctx, &config, sink, reporter) + // Need kubeclient in the context to make the adapter + adapterCtx := context.WithValue(ctx, kubeclient.Key{}, a.kubeClient) + adapter := a.adapterCtor(adapterCtx, &config, sink, reporter) // TODO: define Limit interface. if sta, ok := adapter.(*stadapter.Adapter); ok {