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

support unaggregated data

Signed-off-by: Alex Meijer <ameijer@kubecost.com>
Alex Meijer 2 лет назад
Родитель
Сommit
5d391573b3
2 измененных файлов с 2 добавлено и 5 удалено
  1. 0 4
      pkg/customcost/props.go
  2. 2 1
      pkg/customcost/types.go

+ 0 - 4
pkg/customcost/props.go

@@ -27,10 +27,6 @@ func ParseCustomCostProperties(props []string) ([]string, error) {
 		}
 	}
 
-	if len(properties) == 0 {
-		properties = []string{string(CustomCostDomainProp)}
-	}
-
 	return properties, nil
 }
 

+ 2 - 1
pkg/customcost/types.go

@@ -168,8 +168,9 @@ func (ccs *CustomCostSet) Add(customCosts []*CustomCost) {
 }
 
 func (ccs *CustomCostSet) Aggregate(aggregateBy []string) error {
+	// when no aggregation, return the original CustomCostSet
 	if len(aggregateBy) == 0 {
-		return fmt.Errorf("found empty aggregateBy")
+		return nil
 	}
 
 	aggMap := make(map[string]*CustomCost)