ソースを参照

support unaggregated data

Signed-off-by: Alex Meijer <ameijer@kubecost.com>
Alex Meijer 2 年 前
コミット
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)