Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
SevenEarth committed Dec 13, 2024
1 parent 726bce4 commit 6a087c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tencentcloud/services/cvm/resource_tc_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,7 @@ func resourceTencentCloudInstanceRead(d *schema.ResourceData, meta interface{})
diskName := v.(string)
if diskName != "" {
hasDataDisksName = true
break
}
}
}
Expand Down Expand Up @@ -1162,7 +1163,7 @@ func resourceTencentCloudInstanceRead(d *schema.ResourceData, meta interface{})
for index, item := range dataDisks {
value := item.(map[string]interface{})
tmpMap := make(map[string]interface{})
diskName := string(index)
diskName := strconv.Itoa(index)
diskType := value["data_disk_type"].(string)
diskSize := int64(value["data_disk_size"].(int))
deleteWithInstance := value["delete_with_instance"].(bool)
Expand Down Expand Up @@ -1274,7 +1275,7 @@ func resourceTencentCloudInstanceRead(d *schema.ResourceData, meta interface{})
})

// check hash and flag
if tmpHash == hashItem[string(index)] && hashItem["flag"] == 0 {
if tmpHash == hashItem[strconv.Itoa(index)] && hashItem["flag"] == 0 {
dataDisk := make(map[string]interface{}, 5)
dataDisk["data_disk_id"] = disk.DiskId
dataDisk["data_disk_size"] = disk.DiskSize
Expand Down

0 comments on commit 6a087c1

Please sign in to comment.