Skip to content

Commit 356ca7a

Browse files
authored
Merge branch 'master' into feature/cvm_cam_role
2 parents 00c59de + 6819428 commit 356ca7a

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ENHANCEMENTS:
66

77
BUG FIXES:
88

9+
* Resource `tencentcloud_instance` fix bug that waiting 5 minutes when cloud disk sold out.
910
* Resource: `tencentcloud_tcr_instance` fix bug that only one tag is effective when setting multiple tags.
1011

1112
## 1.53.7 (March 10, 2021)

tencentcloud/extension_cvm.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ const (
4848
CVM_IMAGE_LOGIN = "TRUE"
4949
CVM_IMAGE_LOGIN_NOT = "FALSE"
5050

51-
CVM_ZONE_NOT_SUPPORT_ERROR = "InvalidParameterValue.ZoneNotSupported"
51+
CVM_ZONE_NOT_SUPPORT_ERROR = "InvalidParameterValue.ZoneNotSupported"
52+
CVM_CLOUD_DISK_SOLD_OUT_ERROR = "ResourceInsufficient.CloudDiskSoldOut"
5253
)
5354

5455
var CVM_CHARGE_TYPE = []string{

tencentcloud/resource_tc_instance.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ import (
8888
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
8989
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
9090
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
91+
sdkErrors "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
9192
cvm "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312"
9293
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
9394
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit"
@@ -610,6 +611,10 @@ func resourceTencentCloudInstanceCreate(d *schema.ResourceData, meta interface{}
610611
if err != nil {
611612
log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n",
612613
logId, request.GetAction(), request.ToJsonString(), err.Error())
614+
e, ok := err.(*sdkErrors.TencentCloudSDKError)
615+
if ok && e.Code == CVM_CLOUD_DISK_SOLD_OUT_ERROR {
616+
return resource.NonRetryableError(e)
617+
}
613618
return retryError(err)
614619
}
615620
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n",

tencentcloud/resource_tc_kubernetes_cluster.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,10 @@ func tkeGetCvmRunInstancesPara(dMap map[string]interface{}, meta interface{},
10781078
request.InstanceCount = &count
10791079

10801080
if v, ok := dMap["hostname"]; ok {
1081-
request.HostName = helper.String(v.(string))
1081+
hostname := v.(string)
1082+
if hostname != "" {
1083+
request.HostName = &hostname
1084+
}
10821085
}
10831086

10841087
cvmJson = request.ToJsonString()

tencentcloud/service_tencentcloud_postgresql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ func (me *PostgresqlService) DescribePostgresqlInstanceById(ctx context.Context,
227227
errRet = err
228228
return
229229
}
230-
if ee.Code == "InvalidParameter" {
230+
if ee.Code == "InvalidParameter" || ee.Code == "ResourceNotFound.InstanceNotFoundError" {
231231
errRet = nil
232232
} else {
233233
errRet = err

0 commit comments

Comments
 (0)