Skip to content

Commit d4c89c3

Browse files
author
“guojunchu”
committed
fix fmt
1 parent 5b71c20 commit d4c89c3

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

tencentcloud/resource_tc_clb_target_group_attachment.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ func resourceTencentCloudClbTargetGroupAttachmentCreate(d *schema.ResourceData,
117117

118118
targetInfos []*clb.TargetGroupInfo
119119
instance *clb.LoadBalancer
120-
//listener *clb.Listener
121-
has bool
122-
err error
120+
has bool
121+
err error
123122
)
124123
if v, ok := d.GetOk("rule_id"); ok {
125124
locationId = v.(string)
@@ -210,7 +209,7 @@ func resourceTencentCloudClbTargetGroupAttachmentRead(d *schema.ResourceData, me
210209

211210
ids := strings.Split(id, FILED_SP)
212211
if len(ids) != 4 {
213-
return fmt.Errorf("CLB target group attachment id must contains clb_id, listernrt_id, target_group_id, rule_id")
212+
return fmt.Errorf("CLB target group attachment id is clb_id#listener_id#target_group_id#rule_id(only required for 7 layer CLB)")
214213
}
215214

216215
has, err := clbService.DescribeAssociateTargetGroups(ctx, ids)
@@ -253,7 +252,7 @@ func resourceTencentCloudClbTargetGroupAttachmentDelete(d *schema.ResourceData,
253252

254253
ids := strings.Split(id, FILED_SP)
255254
if len(ids) != 4 {
256-
return fmt.Errorf("CLB target group attachment id must contains clb_id, listernrt_id, target_group_id, rule_id")
255+
return fmt.Errorf("CLB target group attachment id is clb_id#listener_id#target_group_id#rule_id(only required for 7 layer CLB)")
257256
}
258257

259258
if err := clbService.DisassociateTargetGroups(ctx, ids[0], ids[1], ids[2], ids[3]); err != nil {

tencentcloud/resource_tc_clb_target_group_attachment_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func testAccCheckClbTargetGroupAttachmentDestroy(s *terraform.State) error {
7474

7575
ids := strings.Split(rs.Primary.ID, FILED_SP)
7676
if len(ids) != 4 {
77-
return fmt.Errorf("CLB target group attachment id must contains clb_id, listernrt_id, target_group_id, rule_id")
77+
return fmt.Errorf("CLB target group attachment id is clb_id#listener_id#target_group_id#rule_id(only required for 7 layer CLB)")
7878
}
7979

8080
targetInfos, err = clbService.DescribeTargetGroups(ctx, ids[0], nil)
@@ -120,7 +120,7 @@ func testAccCheckClbTargetGroupAttachmentExists(n string) resource.TestCheckFunc
120120

121121
ids := strings.Split(rs.Primary.ID, FILED_SP)
122122
if len(ids) != 4 {
123-
return fmt.Errorf("CLB target group attachment id must contains clb_id, listernrt_id, target_group_id, rule_id")
123+
return fmt.Errorf("CLB target group attachment id is clb_id#listener_id#target_group_id#rule_id(only required for 7 layer CLB)")
124124
}
125125

126126
has, err := clbService.DescribeAssociateTargetGroups(ctx, ids)

0 commit comments

Comments
 (0)