@@ -123,7 +123,7 @@ func resourceTencentCloudKubernetesNodePoolCreatePostHandleResponse0(ctx context
123
123
nodePoolId := * resp .Response .NodePoolId
124
124
125
125
// todo wait for status ok
126
- err := resource .Retry (5 * tccommon . ReadRetryTimeout , func () * resource.RetryError {
126
+ err := resource .Retry (d . Timeout ( schema . TimeoutCreate ) , func () * resource.RetryError {
127
127
nodePool , _ , errRet := service .DescribeNodePool (ctx , clusterId , nodePoolId )
128
128
if errRet != nil {
129
129
return tccommon .RetryError (errRet , tccommon .InternalError )
@@ -160,7 +160,7 @@ func resourceTencentCloudKubernetesNodePoolCreatePostHandleResponse0(ctx context
160
160
}
161
161
162
162
// wait node scaling
163
- if err = waitNodePoolInitializing (ctx , clusterId , nodePoolId ); err != nil {
163
+ if err = waitNodePoolInitializing (ctx , clusterId , nodePoolId , schema . TimeoutCreate ); err != nil {
164
164
return err
165
165
}
166
166
@@ -637,7 +637,7 @@ func resourceTencentCloudKubernetesNodePoolUpdateOnStart(ctx context.Context) er
637
637
capacityHasChanged = true
638
638
639
639
// wait node scaling
640
- if err = waitNodePoolInitializing (ctx , clusterId , nodePoolId ); err != nil {
640
+ if err = waitNodePoolInitializing (ctx , clusterId , nodePoolId , schema . TimeoutUpdate ); err != nil {
641
641
return err
642
642
}
643
643
}
@@ -725,7 +725,7 @@ func resourceTencentCloudKubernetesNodePoolUpdateOnStart(ctx context.Context) er
725
725
}
726
726
727
727
// wait node scaling
728
- if err = waitNodePoolInitializing (ctx , clusterId , nodePoolId ); err != nil {
728
+ if err = waitNodePoolInitializing (ctx , clusterId , nodePoolId , schema . TimeoutUpdate ); err != nil {
729
729
return err
730
730
}
731
731
}
@@ -1418,7 +1418,7 @@ func checkParams(ctx context.Context) error {
1418
1418
return nil
1419
1419
}
1420
1420
1421
- func waitNodePoolInitializing (ctx context.Context , clusterId , nodePoolId string ) (err error ) {
1421
+ func waitNodePoolInitializing (ctx context.Context , clusterId , nodePoolId , step string ) (err error ) {
1422
1422
d := tccommon .ResourceDataFromContext (ctx )
1423
1423
meta := tccommon .ProviderMetaFromContext (ctx )
1424
1424
@@ -1435,6 +1435,13 @@ func waitNodePoolInitializing(ctx context.Context, clusterId, nodePoolId string)
1435
1435
}
1436
1436
1437
1437
if waitNodeReady {
1438
+ var dTimeout string
1439
+ if step == schema .TimeoutCreate {
1440
+ dTimeout = schema .TimeoutCreate
1441
+ } else {
1442
+ dTimeout = schema .TimeoutUpdate
1443
+ }
1444
+
1438
1445
if v , ok := d .GetOkExists ("desired_capacity" ); ok {
1439
1446
desiredCapacity = int64 (v .(int ))
1440
1447
if desiredCapacity == 0 {
@@ -1450,7 +1457,7 @@ func waitNodePoolInitializing(ctx context.Context, clusterId, nodePoolId string)
1450
1457
nodePoolDetailrequest := tke .NewDescribeClusterNodePoolDetailRequest ()
1451
1458
nodePoolDetailrequest .ClusterId = common .StringPtr (clusterId )
1452
1459
nodePoolDetailrequest .NodePoolId = common .StringPtr (nodePoolId )
1453
- err = resource .Retry (10 * tccommon . ReadRetryTimeout , func () * resource.RetryError {
1460
+ err = resource .Retry (d . Timeout ( dTimeout ) , func () * resource.RetryError {
1454
1461
result , e := meta .(tccommon.ProviderMeta ).GetAPIV3Conn ().UseTkeV20180525Client ().DescribeClusterNodePoolDetailWithContext (ctx , nodePoolDetailrequest )
1455
1462
if e != nil {
1456
1463
return tccommon .RetryError (e )
0 commit comments