Plugins: Bump Plugin SDK version and address instance management breaking changes (#68900)

* bump sdk and propagate ctx

* fix tests
This commit is contained in:
Will Browne
2023-05-24 10:19:34 +02:00
committed by GitHub
parent 7e816d010c
commit 286b9e08e9
50 changed files with 199 additions and 170 deletions

View File

@@ -39,7 +39,7 @@ func ProvideService(httpClientProvider httpclient.Provider) *Service {
}
func (s *Service) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {
dsInfo, err := s.getDSInfo(req.PluginContext)
dsInfo, err := s.getDSInfo(ctx, req.PluginContext)
if err != nil {
return &backend.QueryDataResponse{}, err
}
@@ -168,8 +168,8 @@ func newInstanceSettings(httpClientProvider httpclient.Provider) datasource.Inst
}
}
func (s *Service) getDSInfo(pluginCtx backend.PluginContext) (*es.DatasourceInfo, error) {
i, err := s.im.Get(pluginCtx)
func (s *Service) getDSInfo(ctx context.Context, pluginCtx backend.PluginContext) (*es.DatasourceInfo, error) {
i, err := s.im.Get(ctx, pluginCtx)
if err != nil {
return nil, err
}
@@ -189,7 +189,7 @@ func (s *Service) CallResource(ctx context.Context, req *backend.CallResourceReq
return fmt.Errorf("invalid resource URL: %s", req.Path)
}
ds, err := s.getDSInfo(req.PluginContext)
ds, err := s.getDSInfo(ctx, req.PluginContext)
if err != nil {
return err
}