Skip to content

Commit e403967

Browse files
authored
Merge pull request #612 from gailwang/master
fix bugs
2 parents 5ca243a + 1c2b992 commit e403967

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

tencentcloud/resource_tc_clb_instance.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,14 @@ func checkSameName(name string, meta interface{}) (flag bool, errRet error) {
611611
return retryError(e)
612612
}
613613
if len(clbs) > 0 {
614-
flag = true
614+
//this describe function is a fuzzy query
615+
// so take a further check
616+
for _, clb := range clbs {
617+
if *clb.LoadBalancerName == name {
618+
flag = true
619+
return nil
620+
}
621+
}
615622
}
616623
return nil
617624
})

tencentcloud/resource_tc_kubernetes_node_pool.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,12 @@ func resourceKubernetesNodePoolCreate(d *schema.ResourceData, meta interface{})
706706
iAdvanced.Unschedulable = helper.Int64(int64(temp.(int)))
707707
}
708708

709+
nodeOs := d.Get("node_os").(string)
710+
nodeOsType := d.Get("node_os_type").(string)
711+
709712
service := TkeService{client: meta.(*TencentCloudClient).apiV3Conn}
710713

711-
nodePoolId, err := service.CreateClusterNodePool(ctx, clusterId, name, groupParaStr, configParaStr, enableAutoScale, labels, taints, iAdvanced)
714+
nodePoolId, err := service.CreateClusterNodePool(ctx, clusterId, name, groupParaStr, configParaStr, enableAutoScale, nodeOs, nodeOsType, labels, taints, iAdvanced)
712715
if err != nil {
713716
return err
714717
}

tencentcloud/service_tencentcloud_tke.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ func (me *TkeService) ModifyClusterAsGroupAttribute(ctx context.Context, id, asG
947947
return
948948
}
949949

950-
func (me *TkeService) CreateClusterNodePool(ctx context.Context, clusterId, name, groupPara, configPara string, enableAutoScale bool, labels []*tke.Label, taints []*tke.Taint, iAdvanced tke.InstanceAdvancedSettings) (asGroupId string, errRet error) {
950+
func (me *TkeService) CreateClusterNodePool(ctx context.Context, clusterId, name, groupPara, configPara string, enableAutoScale bool, nodeOs string, nodeOsType string, labels []*tke.Label, taints []*tke.Taint, iAdvanced tke.InstanceAdvancedSettings) (asGroupId string, errRet error) {
951951
logId := getLogId(ctx)
952952
request := tke.NewCreateClusterNodePoolRequest()
953953

@@ -962,6 +962,8 @@ func (me *TkeService) CreateClusterNodePool(ctx context.Context, clusterId, name
962962
request.LaunchConfigurePara = &configPara
963963
request.InstanceAdvancedSettings = &iAdvanced
964964
request.EnableAutoscale = &enableAutoScale
965+
request.NodePoolOs = &nodeOs
966+
request.OsCustomizeType = &nodeOsType
965967

966968
if len(labels) > 0 {
967969
request.Labels = labels

0 commit comments

Comments
 (0)