Skip to content

Commit c290d73

Browse files
authored
fix(clb): [119519507] tencentcloud_clb_attachment Adapt to SRV type for targets params (#2806)
* add * add
1 parent 7db62e1 commit c290d73

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

.changelog/2806.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_clb_attachment: support `SRV` type
3+
```

tencentcloud/services/clb/extension_clb.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ const (
136136
CLB_BACKEND_TYPE_ENI = "ENI"
137137
CLB_BACKEND_TYPE_NAT = "NAT"
138138
CLB_BACKEND_TYPE_CCN = "CCN"
139+
CLB_BACKEND_TYPE_SRV = "SRV"
139140
)
140141

141142
const (

tencentcloud/services/clb/resource_tc_clb_attachment.go

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ func resourceTencentCloudClbServerAttachmentRead(d *schema.ResourceData, meta in
293293
}
294294

295295
targets = append(targets, target)
296-
} else if *onlineTarget.Type == CLB_BACKEND_TYPE_ENI || *onlineTarget.Type == CLB_BACKEND_TYPE_NAT || *onlineTarget.Type == CLB_BACKEND_TYPE_CCN {
296+
} else if *onlineTarget.Type == CLB_BACKEND_TYPE_ENI || *onlineTarget.Type == CLB_BACKEND_TYPE_NAT ||
297+
*onlineTarget.Type == CLB_BACKEND_TYPE_CCN || *onlineTarget.Type == CLB_BACKEND_TYPE_SRV {
297298
target := map[string]interface{}{
298299
"weight": int(*onlineTarget.Weight),
299300
"port": int(*onlineTarget.Port),
@@ -306,21 +307,6 @@ func resourceTencentCloudClbServerAttachmentRead(d *schema.ResourceData, meta in
306307

307308
_ = d.Set("targets", targets)
308309

309-
err = resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError {
310-
result, e := clbService.DescribeTargetsByPara(ctx, clbId, listenerId, locationId)
311-
if e != nil {
312-
return tccommon.RetryError(e)
313-
}
314-
315-
instance = result
316-
return nil
317-
})
318-
319-
if err != nil {
320-
log.Printf("[CRITAL]%s read CLB attachment tag failed, reason:%+v", logId, err)
321-
return err
322-
}
323-
324310
return nil
325311
}
326312

0 commit comments

Comments
 (0)