Plugins: Update PDC pattern from latest plugin SDK changes (#76036)

* update with sdk

* do sql

* fix core plugins

* fix proxy settings

* bump SDK version

* tidy

* enable pdc for test

* add codeowners
This commit is contained in:
Will Browne
2023-10-13 14:42:15 +02:00
committed by GitHub
parent e2ba399e30
commit 151f6d6216
35 changed files with 113 additions and 81 deletions
+2 -2
View File
@@ -71,13 +71,13 @@ func queryData(ctx context.Context, queries []backend.DataQuery, dsInfo *es.Data
}
func newInstanceSettings(httpClientProvider httpclient.Provider) datasource.InstanceFactoryFunc {
return func(_ context.Context, settings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
return func(ctx context.Context, settings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
jsonData := map[string]any{}
err := json.Unmarshal(settings.JSONData, &jsonData)
if err != nil {
return nil, fmt.Errorf("error reading settings: %w", err)
}
httpCliOpts, err := settings.HTTPClientOptions()
httpCliOpts, err := settings.HTTPClientOptions(ctx)
if err != nil {
return nil, fmt.Errorf("error getting http options: %w", err)
}