Prechádzať zdrojové kódy

move query endpoints to common code

Signed-off-by: Alex Meijer <ameijer@kubecost.com>
Alex Meijer 2 rokov pred
rodič
commit
f067c23487
2 zmenil súbory, kde vykonal 3 pridanie a 3 odobranie
  1. 0 3
      pkg/cmd/costmodel/costmodel.go
  2. 3 0
      pkg/costmodel/router.go

+ 0 - 3
pkg/cmd/costmodel/costmodel.go

@@ -75,9 +75,6 @@ func Execute(opts *CostModelOpts) error {
 	a.Router.GET("/cloudCost/rebuild", a.CloudCostPipelineService.GetCloudCostRebuildHandler())
 	a.Router.GET("/cloudCost/repair", a.CloudCostPipelineService.GetCloudCostRepairHandler())
 
-	a.Router.GET("/customCost/total", a.CustomCostQueryService.GetCustomCostTotalHandler())
-	a.Router.GET("/customCost/timeseries", a.CustomCostQueryService.GetCustomCostTimeseriesHandler())
-
 	if env.IsPProfEnabled() {
 		a.Router.HandlerFunc(http.MethodGet, "/debug/pprof/", pprof.Index)
 		a.Router.HandlerFunc(http.MethodGet, "/debug/pprof/cmdline", pprof.Cmdline)

+ 3 - 0
pkg/costmodel/router.go

@@ -1846,6 +1846,9 @@ func Initialize(additionalConfigWatchers ...*watcher.ConfigMapWatcher) *Accesses
 	a.Router.GET("/cloud/config/disable", a.CloudConfigController.GetDisableConfigHandler())
 	a.Router.GET("/cloud/config/delete", a.CloudConfigController.GetDeleteConfigHandler())
 
+	a.Router.GET("/customCost/total", a.CustomCostQueryService.GetCustomCostTotalHandler())
+	a.Router.GET("/customCost/timeseries", a.CustomCostQueryService.GetCustomCostTimeseriesHandler())
+
 	a.httpServices.RegisterAll(a.Router)
 
 	return a