@@ -1391,72 +1391,6 @@ func resourceKubernetesNodePoolUpdate(d *schema.ResourceData, meta interface{})
13911391 return err
13921392 }
13931393
1394- //workersInsIdOfNodePool := make([]string, 0)
1395- //_, workers, err := service.DescribeClusterInstances(ctx, clusterId)
1396- //if err != nil {
1397- // return err
1398- //}
1399- //for _, worker := range workers {
1400- // if worker.NodePoolId != "" && worker.NodePoolId == *nodePool.NodePoolId {
1401- // workersInsIdOfNodePool = append(workersInsIdOfNodePool, worker.InstanceId)
1402- // }
1403- //}
1404-
1405- //if d.HasChange("auto_scaling_config.0.enhanced_security_service") {
1406- // const BatchProcessedInsLimit = 100 // limit 100 items to change each request
1407- // launchConfigRaw := d.Get("auto_scaling_config").([]interface{})
1408- // dMap := launchConfigRaw[0].(map[string]interface{})
1409- //
1410- // if v, ok := dMap["enhanced_security_service"]; ok && !v.(bool) {
1411- // // uninstall, cwp/DeleteMachine, need uuid
1412- // // https://cloud.tencent.com/document/product/296/19844
1413- // for i := 0; i < len(workersInsIdOfNodePool); i += BatchProcessedInsLimit {
1414- // var reqInstanceIds []string
1415- // if i+BatchProcessedInsLimit <= len(workersInsIdOfNodePool) {
1416- // reqInstanceIds = workersInsIdOfNodePool[i : i+BatchProcessedInsLimit]
1417- // } else {
1418- // reqInstanceIds = workersInsIdOfNodePool[i:]
1419- // }
1420- // // get uuid
1421- // instanceSet, err := cvmService.DescribeInstanceSetByIds(ctx, helper.StrListToStr(helper.StringsStringsPoint(reqInstanceIds)))
1422- // if err != nil {
1423- // return err
1424- // }
1425- // // call cwp/DeleteMachine
1426- // for _, ins := range instanceSet {
1427- // requestDeleteMachine := cwp.NewDeleteMachineRequest()
1428- // requestDeleteMachine.Uuid = ins.Uuid
1429- // if _, err := client.UseCwpClient().DeleteMachine(requestDeleteMachine); err != nil {
1430- // return err
1431- // }
1432- // }
1433- // }
1434- // } else {
1435- // // default is true, install security agent
1436- // // tat/InvokeCommand, CommandId=cmd-d8jj2skv, instanceId is enough
1437- // // https://cloud.tencent.com/document/product/1340/52678
1438- // for i := 0; i < len(workersInsIdOfNodePool); i += BatchProcessedInsLimit {
1439- // var reqInstanceIds []string
1440- // if i+BatchProcessedInsLimit <= len(workersInsIdOfNodePool) {
1441- // reqInstanceIds = workersInsIdOfNodePool[i : i+BatchProcessedInsLimit]
1442- // } else {
1443- // reqInstanceIds = workersInsIdOfNodePool[i:]
1444- // }
1445- // requestInvokeCommand := tat.NewInvokeCommandRequest()
1446- // requestInvokeCommand.InstanceIds = helper.StringsStringsPoint(reqInstanceIds)
1447- // requestInvokeCommand.CommandId = helper.String(InstallSecurityAgentCommandId)
1448- // requestInvokeCommand.Parameters = helper.String("{}")
1449- // requestInvokeCommand.Timeout = helper.Uint64(60)
1450- // _, err := client.UseTatClient().InvokeCommand(requestInvokeCommand)
1451- // if err != nil {
1452- // log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n",
1453- // logId, request.GetAction(), request.ToJsonString(), err.Error())
1454- // return err
1455- // }
1456- // }
1457- //
1458- // }
1459- //}
14601394 d .SetPartial ("auto_scaling_config" )
14611395 }
14621396
0 commit comments