From 336c0aa7f662e00ef3bc11bcf60becab9b650c4d Mon Sep 17 00:00:00 2001 From: Anshul Khandelwal <12948312+k-anshul@users.noreply.github.com> Date: Mon, 18 Dec 2023 17:30:30 +0530 Subject: [PATCH] Update runtime/reconcilers/source.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Benjamin Egelund-Müller --- runtime/reconcilers/source.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/runtime/reconcilers/source.go b/runtime/reconcilers/source.go index 0cdc2c99221..68f7b76ad9f 100644 --- a/runtime/reconcilers/source.go +++ b/runtime/reconcilers/source.go @@ -385,21 +385,13 @@ func (r *SourceReconciler) ingestSource(ctx context.Context, self *runtimev1.Res } func (r *SourceReconciler) driversSource(ctx context.Context, self *runtimev1.Resource, propsPB *structpb.Struct) (map[string]any, error) { - props := propsPB.AsMap() - spec := self.Resource.(*runtimev1.Resource_Source).Source.Spec - state := self.Resource.(*runtimev1.Resource_Source).Source.State - - var err error - props, err = resolveTemplateProps(ctx, props, rillv1.TemplateResource{ + tself := rillv1.TemplateResource{ Meta: self.Meta, - Spec: spec, - State: state, - }, r.C) - if err != nil { - return nil, err + Spec: self.GetSource().Spec, + State: self.GetSource().State, } - return props, nil + return resolveTemplateProps(ctx, propsPB.AsMap(), tself, r.C) } func driversSink(conn drivers.Handle, tableName string) (map[string]any, error) {