From bae2beaec1e015ff9c16cc134dfd0ec601a66625 Mon Sep 17 00:00:00 2001 From: I584814 Date: Wed, 17 Jul 2024 06:14:52 +0000 Subject: [PATCH] modified timeout for subaccount subscription --- .../resource_subaccount_subscription.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/internal/provider/resource_subaccount_subscription.go b/internal/provider/resource_subaccount_subscription.go index a281b3de..9e2bb30f 100644 --- a/internal/provider/resource_subaccount_subscription.go +++ b/internal/provider/resource_subaccount_subscription.go @@ -228,6 +228,9 @@ func (rs *subaccountSubscriptionResource) Create(ctx context.Context, req resour return } + timeout := 60 * time.Minute + delay, minTimeout := tfutils.CalculateDelayAndMinTimeOut(timeout) + createStateConf := &tfutils.StateChangeConf{ Pending: []string{saas_manager_service.StateInProcess}, Target: []string{saas_manager_service.StateSubscribed}, @@ -245,9 +248,9 @@ func (rs *subaccountSubscriptionResource) Create(ctx context.Context, req resour return subRes, subRes.State, nil }, - Timeout: 10 * time.Minute, - Delay: 5 * time.Second, - MinTimeout: 5 * time.Second, + Timeout: timeout, + Delay: delay, + MinTimeout: minTimeout, } updatedRes, err := createStateConf.WaitForStateContext(ctx) @@ -291,6 +294,9 @@ func (rs *subaccountSubscriptionResource) Delete(ctx context.Context, req resour return } + timeout := 60 * time.Minute + delay, minTimeout := tfutils.CalculateDelayAndMinTimeOut(timeout) + deleteStateConf := &tfutils.StateChangeConf{ Pending: []string{saas_manager_service.StateInProcess}, Target: []string{saas_manager_service.StateNotSubscribed}, @@ -308,9 +314,9 @@ func (rs *subaccountSubscriptionResource) Delete(ctx context.Context, req resour return subRes, subRes.State, nil }, - Timeout: 10 * time.Minute, - Delay: 5 * time.Second, - MinTimeout: 5 * time.Second, + Timeout: timeout, + Delay: delay, + MinTimeout: minTimeout, } _, err = deleteStateConf.WaitForStateContext(ctx)