Skip to content

Commit 4f087ac

Browse files
authored
Merge pull request #618 from rostachen/master
tke upgrade instances timeout depend on instance number
2 parents c22aa31 + 9d2eb76 commit 4f087ac

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
## 1.56.4 (Unreleased)
1+
## 1.56.5 (Unreleased)
2+
## 1.56.4 (April 26, 2021)
3+
4+
BUG FIXES:
5+
6+
* Resource: `tencentcloud_kubernetes_cluster` upgrade instances timeout depend on instance number.
7+
28
## 1.56.3 (April 25, 2021)
39

410
ENHANCEMENTS:

tencentcloud/resource_tc_kubernetes_cluster.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ import (
273273
"net"
274274
"strconv"
275275
"strings"
276+
"time"
276277

277278
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
278279
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
@@ -1321,7 +1322,8 @@ func upgradeClusterInstances(tkeService TkeService, ctx context.Context, id stri
13211322
}
13221323
}
13231324
log.Println("instancesIds for upgrade:", instanceIds)
1324-
if len(instanceIds) == 0 {
1325+
instNum := len(instanceIds)
1326+
if instNum == 0 {
13251327
return nil
13261328
}
13271329

@@ -1337,8 +1339,9 @@ func upgradeClusterInstances(tkeService TkeService, ctx context.Context, id stri
13371339
return err
13381340
}
13391341

1340-
// check update status
1341-
err = resource.Retry(readRetryTimeout, func() *resource.RetryError {
1342+
// check update status: upgrade instance one by one, so timeout depend on instance number.
1343+
timeout := readRetryTimeout * time.Duration(instNum)
1344+
err = resource.Retry(timeout, func() *resource.RetryError {
13421345
done, inErr := tkeService.GetUpgradeInstanceResult(ctx, id)
13431346
if inErr != nil {
13441347
return retryError(inErr)

0 commit comments

Comments
 (0)