Explorar el Código

Merge pull request #2687 from Sean-Holcomb/sth/cloud-cost-status-empty-result

cloud cost status returns empty slice instead of nil
Sean Holcomb hace 2 años
padre
commit
2784a847a6
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  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