Skip to content

Commit e4e2b13

Browse files
tongyimingmikatong
and
mikatong
authored
fix(cbs): [136915341]fix prepaid_period update (#3187)
* fix prepaid_period update * add changelog --------- Co-authored-by: mikatong <[email protected]>
1 parent 963f008 commit e4e2b13

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.changelog/3187.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_cbs_storage: fix prepaid_period update
3+
```

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)