From 6a087c1dfc508dc0c0c5d219ea0a6a5e8d470ee0 Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Fri, 13 Dec 2024 19:39:39 +0800 Subject: [PATCH] add --- tencentcloud/services/cvm/resource_tc_instance.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tencentcloud/services/cvm/resource_tc_instance.go b/tencentcloud/services/cvm/resource_tc_instance.go index 8353c85a5a..a526dbeb0f 100644 --- a/tencentcloud/services/cvm/resource_tc_instance.go +++ b/tencentcloud/services/cvm/resource_tc_instance.go @@ -1025,6 +1025,7 @@ func resourceTencentCloudInstanceRead(d *schema.ResourceData, meta interface{}) diskName := v.(string) if diskName != "" { hasDataDisksName = true + break } } } @@ -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) @@ -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