DataSource: Fix openapi spec (#112150)
This commit is contained in:
@@ -24,7 +24,6 @@ import (
|
||||
queryV0 "github.com/grafana/grafana/pkg/apis/query/v0alpha1"
|
||||
grafanaregistry "github.com/grafana/grafana/pkg/apiserver/registry/generic"
|
||||
"github.com/grafana/grafana/pkg/configprovider"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/sources"
|
||||
"github.com/grafana/grafana/pkg/promlib/models"
|
||||
@@ -50,7 +49,6 @@ type DataSourceAPIBuilder struct {
|
||||
contextProvider PluginContextWrapper
|
||||
accessControl accesscontrol.AccessControl
|
||||
queryTypes *queryV0.QueryTypeDefinitionList
|
||||
log log.Logger
|
||||
configCrudUseNewApis bool
|
||||
}
|
||||
|
||||
@@ -65,10 +63,10 @@ func RegisterAPIService(
|
||||
reg prometheus.Registerer,
|
||||
) (*DataSourceAPIBuilder, error) {
|
||||
// We want to expose just a limited set of plugins
|
||||
explictPluginList := features.IsEnabledGlobally(featuremgmt.FlagDatasourceAPIServers)
|
||||
explicitPluginList := features.IsEnabledGlobally(featuremgmt.FlagDatasourceAPIServers)
|
||||
|
||||
// This requires devmode!
|
||||
if !explictPluginList && !features.IsEnabledGlobally(featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs) {
|
||||
if !explicitPluginList && !features.IsEnabledGlobally(featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs) {
|
||||
return nil, nil // skip registration unless opting into experimental apis
|
||||
}
|
||||
|
||||
@@ -91,7 +89,7 @@ func RegisterAPIService(
|
||||
}
|
||||
|
||||
for _, pluginJSON := range pluginJSONs {
|
||||
if explictPluginList && !slices.Contains(ids, pluginJSON.ID) {
|
||||
if explicitPluginList && !slices.Contains(ids, pluginJSON.ID) {
|
||||
continue // skip this one
|
||||
}
|
||||
|
||||
@@ -155,7 +153,6 @@ func NewDataSourceAPIBuilder(
|
||||
datasources: datasources,
|
||||
contextProvider: contextProvider,
|
||||
accessControl: accessControl,
|
||||
log: log.New("grafana-apiserver.datasource"),
|
||||
configCrudUseNewApis: configCrudUseNewApis,
|
||||
}
|
||||
if loadQueryTypes {
|
||||
|
||||
@@ -15,7 +15,6 @@ import (
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
"github.com/grafana/grafana/pkg/apis/datasource/v0alpha1"
|
||||
queryV0 "github.com/grafana/grafana/pkg/apis/query/v0alpha1"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/models"
|
||||
)
|
||||
@@ -28,7 +27,6 @@ func TestSubQueryConnect(t *testing.T) {
|
||||
},
|
||||
datasources: mockDatasources{},
|
||||
contextProvider: mockContextProvider{},
|
||||
log: log.NewNopLogger(),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -73,7 +71,6 @@ func TestSubQueryConnectWhenDatasourceNotFound(t *testing.T) {
|
||||
},
|
||||
datasources: mockDatasources{},
|
||||
contextProvider: mockContextProvider{},
|
||||
log: log.NewNopLogger(),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user