Kaynağa Gözat

cloud cost status returns empty slice instead of nil

Signed-off-by: Sean Holcomb <seanholcomb@gmail.com>
Sean Holcomb 2 yıl önce
ebeveyn
işleme
31282a982c
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      pkg/cloudcost/pipelineservice.go

+ 3 - 1
pkg/cloudcost/pipelineservice.go

@@ -35,9 +35,11 @@ func NewPipelineService(repo Repository, ic *config.Controller, ingConf Ingestor
 // Status merges status values from the config.Controller and the IngestionManager to give a combined view of that state
 // of configs and their ingestion status
 func (dp *PipelineService) Status() []Status {
-	var statuses []Status
 	// Pull config status from the config controller
 	confStatuses := dp.configController.GetStatus()
+
+	statuses := make([]Status, 0, len(confStatuses))
+
 	refreshRate := time.Hour * time.Duration(env.GetCloudCostRefreshRateHours())
 	for _, confStat := range confStatuses {
 		var conf cloudconfig.Config