Skip to content

Commit

Permalink
🐛 fix provider scaffolding (#2038)
Browse files Browse the repository at this point in the history
Signed-off-by: Marius Kimmina <[email protected]>
  • Loading branch information
mariuskimmina authored Oct 2, 2023
1 parent 82a0179 commit 702c436
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/provider-scaffold/template/provider/provider.go.template
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
asset.Connections[0].Id = conn.ID()
s.runtimes[conn.ID()] = &plugin.Runtime{
Connection: conn,
Resources: map[string]plugin.Resource{},
Callback: callback,
HasRecording: req.HasRecording,
CreateResource: resources.CreateResource,
Expand Down Expand Up @@ -154,7 +153,7 @@ func (s *Service) GetData(req *plugin.DataReq) (*plugin.DataRes, error) {
}, nil
}

resource, ok := runtime.Resources[req.Resource+"\x00"+req.ResourceId]
resource, ok := runtime.Resources.Get(req.Resource + "\x00" + req.ResourceId)
if !ok {
// Note: Since resources are internally always created, there are only very
// few cases where we arrive here:
Expand Down Expand Up @@ -184,3 +183,7 @@ func (s *Service) GetData(req *plugin.DataReq) (*plugin.DataRes, error) {
func (s *Service) StoreData(req *plugin.StoreReq) (*plugin.StoreRes, error) {
return nil, errors.New("not yet implemented")
}

func (s *Service) MockConnect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*plugin.ConnectRes, error) {
return nil, errors.New("mock connect not yet implemented")
}

0 comments on commit 702c436

Please sign in to comment.