From f158d52ae459c6f763a75eea78788d6cbcc17e6c Mon Sep 17 00:00:00 2001 From: Todd Treece <360020+toddtreece@users.noreply.github.com> Date: Wed, 14 Aug 2024 15:28:57 -0400 Subject: [PATCH] Aggregator: Rename DataServiceType to QueryServiceType (#91929) --- pkg/aggregator/apis/aggregation/types.go | 4 ++-- pkg/aggregator/apis/aggregation/v0alpha1/types.go | 4 ++-- .../apis/aggregation/v0alpha1/zz_generated.openapi.go | 4 ++-- pkg/aggregator/apiserver/handler_plugin.go | 2 +- pkg/aggregator/apiserver/handler_plugin_test.go | 2 +- pkg/aggregator/examples/prometheus.yml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/aggregator/apis/aggregation/types.go b/pkg/aggregator/apis/aggregation/types.go index cb7509cbd9d..67a3654f774 100644 --- a/pkg/aggregator/apis/aggregation/types.go +++ b/pkg/aggregator/apis/aggregation/types.go @@ -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 diff --git a/pkg/aggregator/apis/aggregation/v0alpha1/types.go b/pkg/aggregator/apis/aggregation/v0alpha1/types.go index 0f48260728d..2f9c6439daa 100644 --- a/pkg/aggregator/apis/aggregation/v0alpha1/types.go +++ b/pkg/aggregator/apis/aggregation/v0alpha1/types.go @@ -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 diff --git a/pkg/aggregator/apis/aggregation/v0alpha1/zz_generated.openapi.go b/pkg/aggregator/apis/aggregation/v0alpha1/zz_generated.openapi.go index da85a4c88d9..16a31a94a21 100644 --- a/pkg/aggregator/apis/aggregation/v0alpha1/zz_generated.openapi.go +++ b/pkg/aggregator/apis/aggregation/v0alpha1/zz_generated.openapi.go @@ -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": { diff --git a/pkg/aggregator/apiserver/handler_plugin.go b/pkg/aggregator/apiserver/handler_plugin.go index f9f47a9aa3b..f375ab523a0 100644 --- a/pkg/aggregator/apiserver/handler_plugin.go +++ b/pkg/aggregator/apiserver/handler_plugin.go @@ -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: diff --git a/pkg/aggregator/apiserver/handler_plugin_test.go b/pkg/aggregator/apiserver/handler_plugin_test.go index 125d4dacfc2..c6110b64b6e 100644 --- a/pkg/aggregator/apiserver/handler_plugin_test.go +++ b/pkg/aggregator/apiserver/handler_plugin_test.go @@ -27,7 +27,7 @@ func TestQueryDataHandler(t *testing.T) { Version: "v1", Services: []v0alpha1.Service{ { - Type: v0alpha1.DataServiceType, + Type: v0alpha1.QueryServiceType, }, }, }, diff --git a/pkg/aggregator/examples/prometheus.yml b/pkg/aggregator/examples/prometheus.yml index 44379aec765..06e137f7cc7 100644 --- a/pkg/aggregator/examples/prometheus.yml +++ b/pkg/aggregator/examples/prometheus.yml @@ -6,4 +6,4 @@ spec: group: prometheus.grafana.app version: v0alpha1 services: - - type: data + - type: query