@@ -654,7 +654,9 @@ func composedKubernetesAsScalingConfigParaSerial(dMap map[string]interface{}, me
654654 deleteWithInstance , dOk := value ["delete_with_instance" ].(bool )
655655 dataDisk := as.DataDisk {
656656 DiskType : & diskType ,
657- DiskSize : & diskSize ,
657+ }
658+ if diskSize > 0 {
659+ dataDisk .DiskSize = & diskSize
658660 }
659661 if snapshotId != "" {
660662 dataDisk .SnapshotId = & snapshotId
@@ -796,7 +798,9 @@ func composeAsLaunchConfigModifyRequest(d *schema.ResourceData, launchConfigId s
796798 deleteWithInstance , dOk := value ["delete_with_instance" ].(bool )
797799 dataDisk := as.DataDisk {
798800 DiskType : & diskType ,
799- DiskSize : & diskSize ,
801+ }
802+ if diskSize > 0 {
803+ dataDisk .DiskSize = & diskSize
800804 }
801805 if snapshotId != "" {
802806 dataDisk .SnapshotId = & snapshotId
@@ -1127,7 +1131,6 @@ func resourceKubernetesNodePoolCreate(d *schema.ResourceData, meta interface{})
11271131 logId = getLogId (contextNil )
11281132 ctx = context .WithValue (context .TODO (), logIdKey , logId )
11291133 clusterId = d .Get ("cluster_id" ).(string )
1130- nodeConfig = d .Get ("node_config" ).([]interface {})
11311134 enableAutoScale = d .Get ("enable_auto_scale" ).(bool )
11321135 configParas = d .Get ("auto_scaling_config" ).([]interface {})
11331136 name = d .Get ("name" ).(string )
@@ -1137,10 +1140,6 @@ func resourceKubernetesNodePoolCreate(d *schema.ResourceData, meta interface{})
11371140 return fmt .Errorf ("need only one auto_scaling_config" )
11381141 }
11391142
1140- if len (nodeConfig ) > 1 {
1141- return fmt .Errorf ("need only one node_config" )
1142- }
1143-
11441143 groupParaStr , err := composeParameterToAsScalingGroupParaSerial (d )
11451144 if err != nil {
11461145 return err
@@ -1155,13 +1154,8 @@ func resourceKubernetesNodePoolCreate(d *schema.ResourceData, meta interface{})
11551154 taints := GetTkeTaints (d , "taints" )
11561155
11571156 //compose InstanceAdvancedSettings
1158- if workConfig , ok := d .GetOk ("node_config" ); ok {
1159- workConfigList := workConfig .([]interface {})
1160- if len (workConfigList ) == 1 {
1161- workConfigPara := workConfigList [0 ].(map [string ]interface {})
1162- setting := tkeGetInstanceAdvancedPara (workConfigPara , meta )
1163- iAdvanced = setting
1164- }
1157+ if workConfig , ok := helper .InterfacesHeadMap (d , "node_config" ); ok {
1158+ iAdvanced = tkeGetInstanceAdvancedPara (workConfig , meta )
11651159 }
11661160
11671161 if temp , ok := d .GetOk ("extra_args" ); ok {
0 commit comments