Переглянути джерело

Match handling of unknown regions in previous version

These are silently skipped - logging them was very alarming!

Signed-off-by: Christian Muirhead <christian.muirhead@microsoft.com>
Christian Muirhead 3 роки тому
батько
коміт
c1445bb1e8
1 змінених файлів з 3 додано та 2 видалено
  1. 3 2
      pkg/cloud/azureprovider.go

+ 3 - 2
pkg/cloud/azureprovider.go

@@ -334,7 +334,7 @@ func toRegionID(meterRegion string, regions map[string]string) (string, error) {
 			return regionID, nil
 		}
 	}
-	return "", fmt.Errorf("Couldn't find region")
+	return "", fmt.Errorf("Couldn't find region %q", meterRegion)
 }
 
 // azure has very inconsistent naming standards between display names from the rate card api and display names from the regions api
@@ -926,7 +926,8 @@ func convertMeterToPricings(info commerce.MeterInfo, regions map[string]string,
 
 	region, err := toRegionID(meterRegion, regions)
 	if err != nil {
-		return nil, err
+		// Skip this meter if we don't recognize the region.
+		return nil, nil
 	}
 
 	if strings.Contains(meterSubCategory, "Windows") {