Skip to content

Commit

Permalink
increase wait time from 5s to 30s for tanzukubernetescluster
Browse files Browse the repository at this point in the history
Signed-off-by: Xianping <zxianping@vmware.com>
  • Loading branch information
Axpz committed Feb 20, 2024
1 parent aa47e00 commit 855e216
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/resources/tanzukubernetescluster/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import (

type ClusterClassModifierFunc func(tfVariable interface{}, modelVariable interface{}) interface{}

// Adding 30sec wait time status query especially for cluster/nodepool

Check failure on line 30 in internal/resources/tanzukubernetescluster/helper.go

View workflow job for this annotation

GitHub Actions / lint

Comment should end in a period (godot)
const waitTime = 30 * time.Second

// readResourceWait helps read operations where wait is needed for the Tanzu Kubernetes Cluster and its assets to be in a stop status.
// This function determines whether a timeout is needed and whether to fail the request if a deadline has exceeded.
func readResourceWait(ctx context.Context, config *authctx.TanzuContext, clusterFn *tanzukubernetesclustermodels.VmwareTanzuManageV1alpha1ManagementClusterProvisionerTanzukubernetesClusterFullName, existingNodePools []*tkcnodepoolmodels.VmwareTanzuManageV1alpha1ManagementClusterProvisionerTanzukubernetesClusterNodepool, timeoutPolicy map[string]interface{}) (resp *tanzukubernetesclustermodels.VmwareTanzuManageV1alpha1ManagementClusterProvisionerTanzukubernetesClusterData, err error) {
Expand Down Expand Up @@ -115,7 +118,7 @@ func waitClusterReady(ctx context.Context, config *authctx.TanzuContext, cluster
}

for !isStopStatus {
time.Sleep(5 * time.Second)
time.Sleep(waitTime)

err := ctx.Err()

Expand Down Expand Up @@ -193,7 +196,7 @@ func waitNodePoolsReady(ctx context.Context, config *authctx.TanzuContext, clust
}

if !nodePoolsReady {
time.Sleep(5 * time.Second)
time.Sleep(waitTime)

err := ctx.Err()

Expand Down Expand Up @@ -247,7 +250,7 @@ func waitKubeConfigReady(ctx context.Context, config *authctx.TanzuContext, clus
isStopStatus := false

for !isStopStatus {
time.Sleep(5 * time.Second)
time.Sleep(waitTime)

err := ctx.Err()

Expand Down

0 comments on commit 855e216

Please sign in to comment.