Skip to content

fix(gaap): [123456789]gaap error page problem #2724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tencentcloud/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ var retryableErrorCode = []string{
"OperationDenied.InstanceStatusLimitError",
// apigw
"UnsupportedOperation.UnsupportedDeleteService",
// gaap
"FailedOperation.ListenerHasTask",
}

// retryableCosErrorCode is retryable error code for COS/CI SDK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func dataSourceTencentCloudGaapProxyGroupsRead(d *schema.ResourceData, meta inte
}
tmpSet = append(tmpSet, &filter)
}
paramMap["filters"] = tmpSet
paramMap["Filters"] = tmpSet
}

if v, ok := d.GetOk("tag_set"); ok {
Expand All @@ -258,7 +258,7 @@ func dataSourceTencentCloudGaapProxyGroupsRead(d *schema.ResourceData, meta inte
}
tmpSet = append(tmpSet, &tagPair)
}
paramMap["tag_set"] = tmpSet
paramMap["TagSet"] = tmpSet
}

service := GaapService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()}
Expand Down
31 changes: 31 additions & 0 deletions tencentcloud/services/gaap/service_tencentcloud_gaap.go
Original file line number Diff line number Diff line change
Expand Up @@ -3208,6 +3208,22 @@ func (me *GaapService) CreateDomainErrorPageInfo(ctx context.Context,
}); err != nil {
return "", helper.WrapErrorf(err, "", "", "create gaap domain error page info failed")
}
describeRequest := gaap.NewDescribeDomainErrorPageInfoByIdsRequest()
describeRequest.ErrorPageIds = []*string{&id}
if err := resource.Retry(3*tccommon.ReadRetryTimeout, func() *resource.RetryError {
describeResponse, err := client.DescribeDomainErrorPageInfoByIds(describeRequest)
if err != nil {
return tccommon.RetryError(err)
}

if describeResponse.Response != nil && len(describeResponse.Response.ErrorPageSet) == 0 {
return resource.RetryableError(fmt.Errorf("creating error page"))
}
return nil

}); err != nil {
return "", err
}

return
}
Expand Down Expand Up @@ -3292,6 +3308,21 @@ func (me *GaapService) DeleteDomainErrorPageInfo(ctx context.Context, id string)
}); err != nil {
return helper.WrapErrorf(err, id, "", "delete domain error page info failed")
}
describeRequest := gaap.NewDescribeDomainErrorPageInfoByIdsRequest()
describeRequest.ErrorPageIds = []*string{&id}
if err := resource.Retry(3*tccommon.ReadRetryTimeout, func() *resource.RetryError {
describeResponse, err := client.DescribeDomainErrorPageInfoByIds(describeRequest)
if err != nil {
return tccommon.RetryError(err)
}

if describeResponse.Response != nil && len(describeResponse.Response.ErrorPageSet) > 0 {
return resource.RetryableError(fmt.Errorf("deleting error page"))
}
return nil
}); err != nil {
return err
}

return nil
}
Expand Down
Loading