Browse Source

Explicity define what is returned for the pricingsourcesummary api

Signed-off-by: pokom <mark.poko@grafana.com>
pokom 3 years ago
parent
commit
3b07c5b06b

+ 3 - 0
pkg/cloud/aliyunprovider.go

@@ -1332,6 +1332,9 @@ func determinePVRegion(pv *v1.PersistentVolume) string {
 	return ""
 }
 
+// PricingSourceSummary returns the pricing source summary for the provider.
+// The summary represents what was _parsed_ from the pricing source, not
+// everything that was _available_ in the pricing source.
 func (a *Alibaba) PricingSourceSummary() interface{} {
 	return a.Pricing
 }

+ 3 - 1
pkg/cloud/awsprovider.go

@@ -2300,7 +2300,9 @@ func (aws *AWS) Regions() []string {
 	return awsRegions
 }
 
-// PricingSourceSummary returns the Pricing field from the AWS struct.
+// PricingSourceSummary returns the pricing source summary for the provider.
+// The summary represents what was _parsed_ from the pricing source, not
+// everything that was _available_ in the pricing source.
 func (aws *AWS) PricingSourceSummary() interface{} {
 	// encode the pricing source summary as a JSON string
 	return aws.Pricing

+ 3 - 0
pkg/cloud/azureprovider.go

@@ -404,6 +404,9 @@ type Azure struct {
 	azureStorageConfig             *AzureStorageConfig
 }
 
+// PricingSourceSummary returns the pricing source summary for the provider.
+// The summary represents what was _parsed_ from the pricing source, not
+// everything that was _available_ in the pricing source.
 func (az *Azure) PricingSourceSummary() interface{} {
 	return az.Pricing
 }

+ 3 - 0
pkg/cloud/customprovider.go

@@ -34,6 +34,9 @@ type CustomProvider struct {
 	Config                  *ProviderConfig
 }
 
+// PricingSourceSummary returns the pricing source summary for the provider.
+// The summary represents what was _parsed_ from the pricing source, not what
+// was returned from the relevant API.
 func (cp *CustomProvider) PricingSourceSummary() interface{} {
 	return cp.Pricing
 }

+ 3 - 0
pkg/cloud/gcpprovider.go

@@ -1578,6 +1578,9 @@ func getUsageType(labels map[string]string) string {
 	return "ondemand"
 }
 
+// PricingSourceSummary returns the pricing source summary for the provider.
+// The summary represents what was _parsed_ from the pricing source, not
+// everything that was _available_ in the pricing source.
 func (gcp *GCP) PricingSourceSummary() interface{} {
 	return gcp.Pricing
 }

+ 3 - 0
pkg/cloud/scalewayprovider.go

@@ -38,6 +38,9 @@ type Scaleway struct {
 	DownloadPricingDataLock sync.RWMutex
 }
 
+// PricingSourceSummary returns the pricing source summary for the provider.
+// The summary represents what was _parsed_ from the pricing source, not
+// everything that was _available_ in the pricing source.
 func (c *Scaleway) PricingSourceSummary() interface{} {
 	return c.Pricing
 }