Explorar el Código

Merge pull request #464 from kubecost/AjayTripathy-add-region

support casing mismatch between k8s and provider
Ajay Tripathy hace 5 años
padre
commit
c5fdd71380
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      pkg/cloud/csvprovider.go

+ 2 - 2
pkg/cloud/csvprovider.go

@@ -118,8 +118,8 @@ func (c *CSVProvider) DownloadPricingData() error {
 		}
 		}
 		klog.V(4).Infof("Found price info %+v", p)
 		klog.V(4).Infof("Found price info %+v", p)
 		key := p.InstanceID
 		key := p.InstanceID
-		if p.Region != "" {
-			key = fmt.Sprintf("%s,%s", p.Region, p.InstanceID)
+		if p.Region != "" { // strip the casing from region and add to key.
+			key = fmt.Sprintf("%s,%s", strings.ToLower(p.Region), p.InstanceID)
 			c.UsesRegion = true
 			c.UsesRegion = true
 		}
 		}
 		if p.AssetClass == "pv" {
 		if p.AssetClass == "pv" {