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 e1f8449 commit 726bce4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tencentcloud/services/cvm/resource_tc_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -1167,8 +1167,8 @@ func resourceTencentCloudInstanceRead(d *schema.ResourceData, meta interface{})
diskSize := int64(value["data_disk_size"].(int))
deleteWithInstance := value["delete_with_instance"].(bool)
encrypt := value["encrypt"].(bool)
if v, ok := value["data_disk_name"].(string); ok && v != "" {
diskName = v
if tmpV, ok := value["data_disk_name"].(string); ok && tmpV != "" {
diskName = tmpV
}

diskObj := diskHash{
Expand Down Expand Up @@ -1231,7 +1231,7 @@ func resourceTencentCloudInstanceRead(d *schema.ResourceData, meta interface{})
}
}

// has disk name first
// has set disk name first
for _, disk := range instance.DataDisks {
for _, hashItem := range dDiskHash {
diskName := *disk.DiskName
Expand All @@ -1243,7 +1243,7 @@ func resourceTencentCloudInstanceRead(d *schema.ResourceData, meta interface{})
})

// get disk name
if _, ok := hashItem[diskName]; ok {
if v, ok := hashItem[diskName].(string); ok && v != "" {
// check hash and flag
if tmpHash == hashItem[diskName] && hashItem["flag"] == 0 {
dataDisk := make(map[string]interface{}, 5)
Expand All @@ -1263,7 +1263,7 @@ func resourceTencentCloudInstanceRead(d *schema.ResourceData, meta interface{})
}
}

// no disk name last
// no set disk name last
for _, disk := range instance.DataDisks {
for index, hashItem := range dDiskHash {
tmpHash := getDataDiskHash(diskHash{
Expand Down

0 comments on commit 726bce4

Please sign in to comment.