Skip to content

Commit 0ef3288

Browse files
authored
Merge pull request #520 from longkai/rm-zone-region-check
remove zone string contains region name checks
2 parents 4171c7f + ea3647c commit 0ef3288

File tree

3 files changed

+0
-16
lines changed

3 files changed

+0
-16
lines changed

tencentcloud/data_source_tc_redis_instances.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ package tencentcloud
1717

1818
import (
1919
"context"
20-
"fmt"
2120
"log"
22-
"strings"
2321

2422
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
2523
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
@@ -182,9 +180,6 @@ func dataSourceTencentRedisInstancesRead(d *schema.ResourceData, meta interface{
182180
tempStr := temp.(string)
183181
if tempStr != "" {
184182
zone = tempStr
185-
if !strings.Contains(zone, region) {
186-
return fmt.Errorf("zone[%s] not in region[%s]", zone, region)
187-
}
188183
}
189184
}
190185
if temp, ok := d.GetOk("search_key"); ok {

tencentcloud/resource_tc_kubernetes_cluster.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,12 +741,7 @@ func tkeGetCvmRunInstancesPara(dMap map[string]interface{}, meta interface{},
741741

742742
place.ProjectId = &projectId
743743

744-
configRegion := meta.(*TencentCloudClient).apiV3Conn.Region
745744
if v, ok := dMap["availability_zone"]; ok {
746-
if !strings.Contains(v.(string), configRegion) {
747-
errRet = fmt.Errorf("availability_zone[%s] should in [%s]", v.(string), configRegion)
748-
return
749-
}
750745
place.Zone = helper.String(v.(string))
751746
}
752747

tencentcloud/resource_tc_redis_instance.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,6 @@ func resourceTencentCloudRedisInstanceCreate(d *schema.ResourceData, meta interf
245245
}
246246
}
247247

248-
if availabilityZone != "" {
249-
if !strings.Contains(availabilityZone, region) {
250-
return fmt.Errorf("zone[%s] not in region[%s]", availabilityZone, region)
251-
}
252-
}
253-
254248
if (typeId == 0 && redisType == "") || (typeId != 0 && redisType != "") {
255249
return fmt.Errorf("`type_id` and `type` set one item and only one item")
256250
}

0 commit comments

Comments
 (0)