Browse Source

Use default region if no region is found in PVKey.Features

isra17 4 years ago
parent
commit
9a45a54a2a
1 changed files with 4 additions and 4 deletions
  1. 4 4
      pkg/cloud/awsprovider.go

+ 4 - 4
pkg/cloud/awsprovider.go

@@ -559,10 +559,10 @@ func (key *awsPVKey) Features() string {
 	// Storage class names are generally EBS volume types (gp2)
 	// Keys in Pricing are based on UsageTypes (EBS:VolumeType.gp2)
 	// Converts between the 2
-	region, _ := util.GetRegion(key.Labels)
-	//if region == "" {
-	//	region = "us-east-1"
-	//}
+	region, ok := util.GetRegion(key.Labels)
+	if !ok {
+		region = key.DefaultRegion
+	}
 	class, ok := volTypes[storageClass]
 	if !ok {
 		klog.V(4).Infof("No voltype mapping for %s's storageClass: %s", key.Name, storageClass)