Skip to content

Commit

Permalink
adds connection_pooler logic for restore (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahadarsh authored Nov 7, 2023
1 parent 7b3368d commit c3749fa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/provider/instance_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,9 @@ func restoreInstance(plan temboInstanceResourceModel,

restoreInstance.SetExtraDomainsRw(getStringArray(plan.ExtraDomainsRw))

/*if plan.ConnectionPooler != nil {
if plan.ConnectionPooler != nil {
restoreInstance.SetConnectionPooler(*getConnectionPooler(plan.ConnectionPooler))
}*/
}

ctx = context.WithValue(ctx, temboclient.ContextAccessToken, r.temboInstanceConfig.accessToken)

Expand Down Expand Up @@ -628,11 +628,6 @@ func setTemboInstanceResourceModel(instanceResourceModel *temboInstanceResourceM
instanceResourceModel.ExtraDomainsRw = localExtraDomainsRw
}

// Restore Mode only sets above fields so skipping the other fields.
if isRestoreMode {
return
}

if instance.ConnectionPooler.Get() != nil {
var localConnectionPooler ConnectionPooler
cp := instance.ConnectionPooler.Get()
Expand All @@ -642,6 +637,11 @@ func setTemboInstanceResourceModel(instanceResourceModel *temboInstanceResourceM
instanceResourceModel.ConnectionPooler = &localConnectionPooler
}

// Restore Mode only sets above fields so skipping the other fields.
if isRestoreMode {
return
}

instanceResourceModel.StackType = types.StringValue(string(instance.StackType))
instanceResourceModel.Replicas = types.Int64Value(int64(instance.GetReplicas()))

Expand Down

0 comments on commit c3749fa

Please sign in to comment.