Aggregator: Rename DataServiceType to QueryServiceType (#91929)

This commit is contained in:
Todd Treece 2024-08-14 15:28:57 -04:00 committed by GitHub
parent 40144eb3c8
commit f158d52ae4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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": {

View File

@ -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:

View File

@ -27,7 +27,7 @@ func TestQueryDataHandler(t *testing.T) {
Version: "v1",
Services: []v0alpha1.Service{
{
Type: v0alpha1.DataServiceType,
Type: v0alpha1.QueryServiceType,
},
},
},

View File

@ -6,4 +6,4 @@ spec:
group: prometheus.grafana.app
version: v0alpha1
services:
- type: data
- type: query