mirror of
https://github.com/grafana/grafana.git
synced 2024-11-28 03:34:15 -06:00
Aggregator: Rename DataServiceType to QueryServiceType (#91929)
This commit is contained in:
parent
40144eb3c8
commit
f158d52ae4
@ -69,8 +69,8 @@ const (
|
||||
AdmissionControlServiceType ServiceType = "admission"
|
||||
// ConversionServiceType maps to pluginv2.ResourceConversion
|
||||
ConversionServiceType ServiceType = "conversion"
|
||||
// DataSourceServiceType maps to pluginv2.Data
|
||||
DataServiceType ServiceType = "data"
|
||||
// QueryServiceType maps to pluginv2.Data
|
||||
QueryServiceType ServiceType = "query"
|
||||
// StreamServiceType maps to pluginv2.Stream
|
||||
StreamServiceType ServiceType = "stream"
|
||||
// RouteServiceType maps pluginv2.Resource
|
||||
|
@ -69,8 +69,8 @@ const (
|
||||
AdmissionControlServiceType ServiceType = "admission"
|
||||
// ConversionServiceType maps to pluginv2.ResourceConversion
|
||||
ConversionServiceType ServiceType = "conversion"
|
||||
// DataSourceServiceType maps to pluginv2.Data
|
||||
DataServiceType ServiceType = "data"
|
||||
// QueryServiceType maps to pluginv2.Data
|
||||
QueryServiceType ServiceType = "query"
|
||||
// StreamServiceType maps to pluginv2.Stream
|
||||
StreamServiceType ServiceType = "stream"
|
||||
// RouteServiceType maps pluginv2.Resource
|
||||
|
@ -326,11 +326,11 @@ func schema_aggregator_apis_aggregation_v0alpha1_Service(ref common.ReferenceCal
|
||||
Properties: map[string]spec.Schema{
|
||||
"type": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Type is the type of service to proxy.\n\nPossible enum values:\n - `\"admission\"` maps to pluginv2.AdmissionControl\n - `\"conversion\"` maps to pluginv2.ResourceConversion\n - `\"data\"` DataSourceServiceType maps to pluginv2.Data\n - `\"datsource-proxy\"` is a reverse proxy for making requests directly to the HTTP URL specified in datasource instance settings.\n - `\"route\"` maps pluginv2.Resource\n - `\"stream\"` maps to pluginv2.Stream",
|
||||
Description: "Type is the type of service to proxy.\n\nPossible enum values:\n - `\"admission\"` maps to pluginv2.AdmissionControl\n - `\"conversion\"` maps to pluginv2.ResourceConversion\n - `\"datsource-proxy\"` is a reverse proxy for making requests directly to the HTTP URL specified in datasource instance settings.\n - `\"query\"` maps to pluginv2.Data\n - `\"route\"` maps pluginv2.Resource\n - `\"stream\"` maps to pluginv2.Stream",
|
||||
Default: "",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
Enum: []interface{}{"admission", "conversion", "data", "datsource-proxy", "route", "stream"},
|
||||
Enum: []interface{}{"admission", "conversion", "datsource-proxy", "query", "route", "stream"},
|
||||
},
|
||||
},
|
||||
"method": {
|
||||
|
@ -43,7 +43,7 @@ func newPluginHandler(
|
||||
|
||||
for _, service := range dataplaneService.Spec.Services {
|
||||
switch service.Type {
|
||||
case aggregationv0alpha1.DataServiceType:
|
||||
case aggregationv0alpha1.QueryServiceType:
|
||||
proxyPath := fmt.Sprintf("/apis/%s/%s/namespaces/{namespace}/connections/{uid}/query", dataplaneService.Spec.Group, dataplaneService.Spec.Version)
|
||||
mux.Handle(proxyPath, h.QueryDataHandler())
|
||||
case aggregationv0alpha1.StreamServiceType:
|
||||
|
@ -27,7 +27,7 @@ func TestQueryDataHandler(t *testing.T) {
|
||||
Version: "v1",
|
||||
Services: []v0alpha1.Service{
|
||||
{
|
||||
Type: v0alpha1.DataServiceType,
|
||||
Type: v0alpha1.QueryServiceType,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -6,4 +6,4 @@ spec:
|
||||
group: prometheus.grafana.app
|
||||
version: v0alpha1
|
||||
services:
|
||||
- type: data
|
||||
- type: query
|
||||
|
Loading…
Reference in New Issue
Block a user