Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug in node pool creation #2170

Merged
merged 1 commit into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个场景要不要加个e2e测试用例?

//request.DataDisks = make([]*as.DataDisk, 0, len(dataDisks))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里看直接把 data_disk 参数去掉了,但是输入还有这个参数呢

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果不设置data_disk 参数,就不初始化,如果设置data_disk 参数,会使用request.DataDisks = append(request.DataDisks, &dataDisk)初始化参数

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
Loading