Skip to content

Commit

Permalink
fix bug in node pool creation (#2170)
Browse files Browse the repository at this point in the history
Co-authored-by: alantlliu <[email protected]>
  • Loading branch information
xiaokouliu and alantlliu authored Oct 8, 2023
1 parent 92e743a commit 5182b44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .changelog/2170.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/tencentcloud_kubernetes_node_pool: fix bug in node pool creation
```
8 changes: 3 additions & 5 deletions tencentcloud/resource_tc_kubernetes_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ func composedKubernetesAsScalingConfigParaSerial(dMap map[string]interface{}, me

if v, ok := dMap["data_disk"]; ok {
dataDisks := v.([]interface{})
request.DataDisks = make([]*as.DataDisk, 0, len(dataDisks))
//request.DataDisks = make([]*as.DataDisk, 0, len(dataDisks))
for _, d := range dataDisks {
value := d.(map[string]interface{})
diskType := value["disk_type"].(string)
Expand Down Expand Up @@ -773,7 +773,7 @@ func composedKubernetesAsScalingConfigParaSerial(dMap map[string]interface{}, me
}
if v, ok := dMap["key_ids"]; ok {
keyIds := v.([]interface{})
request.LoginSettings.KeyIds = make([]*string, 0, len(keyIds))
//request.LoginSettings.KeyIds = make([]*string, 0, len(keyIds))
for i := range keyIds {
keyId := keyIds[i].(string)
request.LoginSettings.KeyIds = append(request.LoginSettings.KeyIds, &keyId)
Expand Down Expand Up @@ -900,7 +900,7 @@ func composeAsLaunchConfigModifyRequest(d *schema.ResourceData, launchConfigId s

if v, ok := dMap["data_disk"]; ok {
dataDisks := v.([]interface{})
request.DataDisks = make([]*as.DataDisk, 0, len(dataDisks))
//request.DataDisks = make([]*as.DataDisk, 0, len(dataDisks))
for _, d := range dataDisks {
value := d.(map[string]interface{})
diskType := value["disk_type"].(string)
Expand Down Expand Up @@ -929,8 +929,6 @@ func composeAsLaunchConfigModifyRequest(d *schema.ResourceData, launchConfigId s
}
request.DataDisks = append(request.DataDisks, &dataDisk)
}
} else {
request.DataDisks = []*as.DataDisk{}
}

request.InternetAccessible = &as.InternetAccessible{}
Expand Down

0 comments on commit 5182b44

Please sign in to comment.