Przeglądaj źródła

few item creation methods

Signed-off-by: Alan Rodrigues <alanr5691@yahoo.com>
Alan Rodrigues 3 lat temu
rodzic
commit
1e291952b4

+ 3 - 3
pkg/kubecost/cloudcostaggregate.go

@@ -86,12 +86,12 @@ type CloudCostAggregate struct {
 	NetCost           float64                      `json:"netCost"`
 }
 
-func NewCloudCostAggregate(properties CloudCostAggregateProperties, kubernetesPercent, cost, credit float64) CloudCostAggregate {
-	return CloudCostAggregate{
+func NewCloudCostAggregate(properties CloudCostAggregateProperties, kubernetesPercent, cost, netCost float64) *CloudCostAggregate {
+	return &CloudCostAggregate{
 		Properties:        properties,
 		KubernetesPercent: kubernetesPercent,
 		Cost:              cost,
-		Credit:            credit,
+		NetCost:           netCost,
 	}
 }
 

+ 3 - 3
pkg/kubecost/cloudcostitem.go

@@ -81,13 +81,13 @@ type CloudCostItem struct {
 }
 
 // NewCloudCostItem instantiates a new CloudCostItem asset
-func NewCloudCostItem(start, end time.Time, cciProperties CloudCostItemProperties, isKubernetes bool, cost, credit float64) CloudCostItem {
-	return CloudCostItem{
+func NewCloudCostItem(start, end time.Time, cciProperties CloudCostItemProperties, isKubernetes bool, cost, netcost float64) *CloudCostItem {
+	return &CloudCostItem{
 		Properties:   cciProperties,
 		IsKubernetes: isKubernetes,
 		Window:       NewWindow(&start, &end),
 		Cost:         cost,
-		Credit:       credit,
+		NetCost:      netcost,
 	}
 }