feat: plan modifiers handling
This commit is contained in:
parent
c9c6dd1852
commit
7c4ca25791
13 changed files with 428 additions and 555 deletions
|
|
@ -53,8 +53,9 @@ func CreateInstanceWaitHandler(
|
|||
) *wait.AsyncActionHandler[postgresflex.GetInstanceResponse] {
|
||||
instanceCreated := false
|
||||
var instanceGetResponse *postgresflex.GetInstanceResponse
|
||||
maxWait := time.Minute * 30
|
||||
maxWait := time.Minute * 45
|
||||
startTime := time.Now()
|
||||
extendedTimeout := 0
|
||||
|
||||
handler := wait.New(
|
||||
func() (waitFinished bool, response *postgresflex.GetInstanceResponse, err error) {
|
||||
|
|
@ -88,11 +89,32 @@ func CreateInstanceWaitHandler(
|
|||
instanceId,
|
||||
),
|
||||
)
|
||||
if extendedTimeout < 3 {
|
||||
maxWait = maxWait + time.Minute*5
|
||||
extendedTimeout = extendedTimeout + 1
|
||||
if s.Network == nil || s.Network.InstanceAddress == nil {
|
||||
tflog.Warn(ctx, "Waiting for instance_address")
|
||||
return false, nil, nil
|
||||
}
|
||||
if s.Network.RouterAddress == nil {
|
||||
tflog.Warn(ctx, "Waiting for router_address")
|
||||
return false, nil, nil
|
||||
}
|
||||
if s.Status == nil {
|
||||
tflog.Warn(ctx, "Waiting for status")
|
||||
return false, nil, nil
|
||||
}
|
||||
if s.IsDeletable == nil {
|
||||
tflog.Warn(ctx, "Waiting for is_deletable")
|
||||
return false, nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
instanceCreated = true
|
||||
instanceGetResponse = s
|
||||
case InstanceStateSuccess:
|
||||
if s.Network == nil || s.Network.InstanceAddress == nil {
|
||||
tflog.Info(ctx, "Waiting for instance_address")
|
||||
tflog.Warn(ctx, "Waiting for instance_address")
|
||||
return false, nil, nil
|
||||
}
|
||||
if s.Network.RouterAddress == nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue