Просмотр исходного кода

WIP debug

Signed-off-by: Alex Meijer <ameijer@kubecost.com>
Niko Kovacevic 3 лет назад
Родитель
Сommit
97c91c94d2
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      pkg/kubecost/allocation.go

+ 4 - 1
pkg/kubecost/allocation.go

@@ -1110,11 +1110,14 @@ func (as *AllocationSet) AggregateBy(aggregateBy []string, options *AllocationAg
 		}
 		}
 	}
 	}
 
 
+	log.Infof("[PARCS] idleSet.Length(): %d", idleSet.Length())
+	log.Infof("[PARCS] idleCoefficients: nil:%t len:%d", idleCoefficients == nil, len(idleCoefficients))
+
 	// (2b) If proportional asset resource costs are to be included, derive them
 	// (2b) If proportional asset resource costs are to be included, derive them
 	// from idle coefficients and add them to the allocations.
 	// from idle coefficients and add them to the allocations.
 	if options.IncludeProportionalAssetResourceCosts {
 	if options.IncludeProportionalAssetResourceCosts {
 		if idleCoefficients == nil {
 		if idleCoefficients == nil {
-			return fmt.Errorf("cannot include proportional resource costs")
+			return fmt.Errorf("cannot include proportional resource costs because idle coefficients are nil")
 		}
 		}
 
 
 		for _, alloc := range as.Allocations {
 		for _, alloc := range as.Allocations {