Skip to content

Commit 94782a9

Browse files
author
mikatong
committed
fix prepaid_period update
1 parent bc4be5e commit 94782a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tencentcloud/services/cbs/resource_tc_cbs_storage.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ func resourceTencentCloudCbsStorageUpdate(d *schema.ResourceData, meta interface
327327
cbsService = CbsService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()}
328328
)
329329

330+
d.Partial(true)
331+
330332
//only support update prepaid_period when upgrade chargeType
331333
if d.HasChange("prepaid_period") && (!d.HasChange("charge_type") && d.Get("charge_type").(string) == CBS_CHARGE_TYPE_PREPAID) {
332334
return fmt.Errorf("tencentcloud_cbs_storage renew is not support yet")
@@ -336,7 +338,6 @@ func resourceTencentCloudCbsStorageUpdate(d *schema.ResourceData, meta interface
336338
return fmt.Errorf("tencentcloud_cbs_storage do not support downgrade instance")
337339
}
338340

339-
d.Partial(true)
340341
storageId := d.Id()
341342
storageName := ""
342343
projectId := -1
@@ -553,7 +554,7 @@ func resourceTencentCloudCbsStorageUpdate(d *schema.ResourceData, meta interface
553554

554555
d.Partial(false)
555556

556-
return nil
557+
return resourceTencentCloudCbsStorageRead(d, meta)
557558
}
558559

559560
func resourceTencentCloudCbsStorageDelete(d *schema.ResourceData, meta interface{}) error {

0 commit comments

Comments
 (0)