Aggregator: Rename DataServiceType to QueryServiceType (#91929)

pull/91863/head
Todd Treece 1 year ago committed by GitHub
parent 40144eb3c8
commit f158d52ae4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      pkg/aggregator/apis/aggregation/types.go
  2. 4
      pkg/aggregator/apis/aggregation/v0alpha1/types.go
  3. 4
      pkg/aggregator/apis/aggregation/v0alpha1/zz_generated.openapi.go
  4. 2
      pkg/aggregator/apiserver/handler_plugin.go
  5. 2
      pkg/aggregator/apiserver/handler_plugin_test.go
  6. 2
      pkg/aggregator/examples/prometheus.yml

@ -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…
Cancel
Save