Przeglądaj źródła

Move price to GB per hour instead of GB per month

Matt Bolt 6 lat temu
rodzic
commit
dcf92449f3
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      pkg/cloud/azureprovider.go

+ 3 - 1
pkg/cloud/azureprovider.go

@@ -408,7 +408,9 @@ func (az *Azure) DownloadPricingData() error {
 						for _, rate := range v.MeterRates {
 							priceInUsd += *rate
 						}
-						priceStr := fmt.Sprintf("%f", priceInUsd)
+						// rate is in GB per month, resolve to GB per hour
+						pricePerHour := priceInUsd / 720.0
+						priceStr := fmt.Sprintf("%f", pricePerHour)
 
 						key := region + "," + storageClass
 						klog.V(4).Infof("Adding PV.Key: %s, Cost: %s", key, priceStr)