Skip to content

Commit e6f98a5

Browse files
committed
fix: add eip task retry
1 parent 12ed922 commit e6f98a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tencentcloud/services/cvm/resource_tc_eip.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,12 @@ func resourceTencentCloudEipCreate(d *schema.ResourceData, meta interface{}) err
244244
if err != nil {
245245
return tccommon.RetryError(err)
246246
}
247-
if taskResponse.Response.Result != nil && *taskResponse.Response.Result == "RUNNING" {
247+
if taskResponse.Response.Result != nil && *taskResponse.Response.Result == svcvpc.VPN_TASK_STATUS_RUNNING {
248248
return resource.RetryableError(errors.New("eip task is running"))
249249
}
250+
if taskResponse.Response.Result != nil && *taskResponse.Response.Result == svcvpc.VPN_TASK_STATUS_FAILED {
251+
return resource.NonRetryableError(errors.New("eip task is failed"))
252+
}
250253
return nil
251254
})
252255
if err != nil {

0 commit comments

Comments
 (0)