Skip to content

feat(clb): [122159253]fix log #3170

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
Feb 28, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func resourceTencentCloudClbCustomizedConfigV2Delete(d *schema.ResourceData, met
} else {
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString())
if result == nil || result.Response == nil || result.Response.RequestId == nil {
return resource.NonRetryableError(fmt.Errorf("Create CLB Customized Config Failed, Response is nil."))
return resource.NonRetryableError(fmt.Errorf("Delete CLB Customized Config Failed, Response is nil."))
}

requestId := *result.Response.RequestId
Expand All @@ -255,7 +255,7 @@ func resourceTencentCloudClbCustomizedConfigV2Delete(d *schema.ResourceData, met
})

if err != nil {
log.Printf("[CRITAL]%s Create CLB Customized Config Failed, reason:%+v", logId, err)
log.Printf("[CRITAL]%s Delete CLB Customized Config Failed, reason:%+v", logId, err)
return err
}
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ func TestAccTencentCloudClbCustomizedConfigV2_basic(t *testing.T) {
t.Parallel()

resource.Test(t, resource.TestCase{
PreCheck: func() { tcacctest.AccPreCheck(t) },
Providers: tcacctest.AccProviders,
CheckDestroy: testAccCheckClbLogsetDestroy,
PreCheck: func() { tcacctest.AccPreCheck(t) },
Providers: tcacctest.AccProviders,
Steps: []resource.TestStep{
{
Config: testAccClbCustomizedConfigV2_basic,
Check: resource.ComposeTestCheckFunc(
testAccCheckClbLogsetExists("tencentcloud_clb_customized_config_v2.example"),
resource.TestCheckResourceAttrSet("tencentcloud_clb_customized_config_v2.example", "create_time"),
resource.TestCheckResourceAttr("tencentcloud_clb_customized_config_v2.example", "name", "clb_custom_config"),
resource.TestCheckResourceAttr("tencentcloud_clb_customized_config_v2.example", "config_name", "tf-example"),
),
},
{
Expand All @@ -33,6 +31,9 @@ func TestAccTencentCloudClbCustomizedConfigV2_basic(t *testing.T) {
}

const testAccClbCustomizedConfigV2_basic = `
resource "tencentcloud_clb_log_set" "test_logset" {
resource "tencentcloud_clb_customized_config_v2" "example" {
config_content = "client_max_body_size 224M;\r\nclient_body_timeout 60s;"
config_name = "tf-example"
config_type = "LOCATION"
}
`
Loading