Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
SevenEarth committed Dec 24, 2024
1 parent 3b3e090 commit 7bb3295
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 0 additions & 2 deletions tencentcloud/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ var retryableErrorCode = []string{
"UnsupportedOperation.UnsupportedDeleteService",
// gaap
"FailedOperation.ListenerHasTask",
// clb
"FailedOperation.ResourceInOperating",
}

// retryableCosErrorCode is retryable error code for COS/CI SDK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
clb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb/v20180317"
sdkErrors "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"

"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
)
Expand Down Expand Up @@ -86,6 +87,12 @@ func resourceTencentCloudClbListenerDefaultDomainCreate(d *schema.ResourceData,
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
result, e := client.ModifyDomainAttributes(request)
if e != nil {
if sdkError, ok := e.(*sdkErrors.TencentCloudSDKError); ok {
if sdkError.Code == "FailedOperation.ResourceInOperating" {
return resource.RetryableError(e)
}
}

return tccommon.RetryError(e)
} else {
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n",
Expand Down Expand Up @@ -211,6 +218,12 @@ func resourceTencentCloudClbListenerDefaultDomainUpdate(d *schema.ResourceData,
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
result, e := client.ModifyDomainAttributes(request)
if e != nil {
if sdkError, ok := e.(*sdkErrors.TencentCloudSDKError); ok {
if sdkError.Code == "FailedOperation.ResourceInOperating" {
return resource.RetryableError(e)
}
}

return tccommon.RetryError(e)
} else {
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n",
Expand Down
7 changes: 7 additions & 0 deletions tencentcloud/services/clb/resource_tc_clb_listener_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/pkg/errors"
clb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb/v20180317"
sdkErrors "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"

"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
)
Expand Down Expand Up @@ -390,6 +391,12 @@ func resourceTencentCloudClbListenerRuleCreate(d *schema.ResourceData, meta inte
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
response, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseClbClient().ModifyDomainAttributes(domainRequest)
if e != nil {
if sdkError, ok := e.(*sdkErrors.TencentCloudSDKError); ok {
if sdkError.Code == "FailedOperation.ResourceInOperating" {
return resource.RetryableError(e)
}
}

return tccommon.RetryError(e)
} else {
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n",
Expand Down

0 comments on commit 7bb3295

Please sign in to comment.