瀏覽代碼

Adding exception for Cloud Services meter subcategory (#2907)

* Adding exception for Cloud Services meter subcategory

For some instance types like D4as v5 opencost fetch Cloud Services price
resulting in reporting more cost than expected. This happens because
Cloud Services meter subcategory isn't ignored like Windows.

Signed-off-by: Raghavendra <raghavendra@rafay.co>

* RC-37682 Msft returns CloudServices incase of Standard_E2as_v5 pricing API respone, while for others it returns Cloud Services. Added CloudServices into check to remove the meter. (#17)

Signed-off-by: Raghavendra <raghavendra@rafay.co>

---------

Signed-off-by: Raghavendra <raghavendra@rafay.co>
Raghavendra Challapali 1 年之前
父節點
當前提交
f4ed4e1813
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      pkg/cloud/azure/provider.go

+ 5 - 0
pkg/cloud/azure/provider.go

@@ -936,6 +936,11 @@ func convertMeterToPricings(info commerce.MeterInfo, regions map[string]string,
 		return nil, nil
 	}
 
+	if strings.Contains(meterSubCategory, "Cloud Services") || strings.Contains(meterSubCategory, "CloudServices") {
+		// This meter doesn't correspond to any pricings.
+		return nil, nil
+	}
+
 	if strings.Contains(meterCategory, "Storage") {
 		if strings.Contains(meterSubCategory, "HDD") || strings.Contains(meterSubCategory, "SSD") || strings.Contains(meterSubCategory, "Premium Files") {
 			var storageClass string = ""