فهرست منبع

Merge pull request #2627 from nik-kc/nik/final_plugin_fixes

Thomas Evans 2 سال پیش
والد
کامیت
29e3ed561c
2فایلهای تغییر یافته به همراه6 افزوده شده و 4 حذف شده
  1. 4 4
      justfile
  2. 2 0
      pkg/costmodel/router.go

+ 4 - 4
justfile

@@ -25,15 +25,15 @@ build-binary VERSION=version:
     cd ./cmd/costmodel && \
         {{commonenv}} GOOS=linux GOARCH=amd64 go build \
         -ldflags \
-          "-X github.com/opencost/opencost/pkg/version.Version={{VERSION}} \
-           -X github.com/opencost/opencost/pkg/version.GitCommit={{commit}}" \
+          "-X github.com/opencost/opencost/core/pkg/version.Version={{VERSION}} \
+           -X github.com/opencost/opencost/core/pkg/version.GitCommit={{commit}}" \
         -o ./costmodel-amd64
 
     cd ./cmd/costmodel && \
         {{commonenv}} GOOS=linux GOARCH=arm64 go build \
         -ldflags \
-          "-X github.com/opencost/opencost/pkg/version.Version={{VERSION}} \
-           -X github.com/opencost/opencost/pkg/version.GitCommit={{commit}}" \
+          "-X github.com/opencost/opencost/core/pkg/version.Version={{VERSION}} \
+           -X github.com/opencost/opencost/core/pkg/version.GitCommit={{commit}}" \
         -o ./costmodel-arm64
 
 # Build and push a multi-arch Docker image

+ 2 - 0
pkg/costmodel/router.go

@@ -1851,6 +1851,8 @@ func Initialize(additionalConfigWatchers ...*watcher.ConfigMapWatcher) *Accesses
 		a.Router.GET("/customCost/timeseries", a.CustomCostQueryService.GetCustomCostTimeseriesHandler())
 	}
 
+	// this endpoint is intentionally left out of the "if env.IsCustomCostEnabled()" conditional; in the handler, it is
+	// valid for CustomCostPipelineService to be nil
 	a.Router.GET("/customCost/status", a.CustomCostPipelineService.GetCustomCostStatusHandler())
 
 	a.httpServices.RegisterAll(a.Router)