@@ -20,8 +20,8 @@ const (
2020
2121// Interface needed for tests
2222type APIClientInstanceInterface interface {
23- GetInstanceExecute (ctx context.Context , projectId , instanceId string ) (* postgresflex.InstanceResponse , error )
24- ListUsersExecute (ctx context.Context , projectId string , instanceId string ) (* postgresflex.ListUsersResponse , error )
23+ GetInstanceExecute (ctx context.Context , projectId , region , instanceId string ) (* postgresflex.InstanceResponse , error )
24+ ListUsersExecute (ctx context.Context , projectId , region , instanceId string ) (* postgresflex.ListUsersResponse , error )
2525}
2626
2727// Interface needed for tests
@@ -30,13 +30,13 @@ type APIClientUserInterface interface {
3030}
3131
3232// CreateInstanceWaitHandler will wait for instance creation
33- func CreateInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , instanceId string ) * wait.AsyncActionHandler [postgresflex.InstanceResponse ] {
33+ func CreateInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , region , instanceId string ) * wait.AsyncActionHandler [postgresflex.InstanceResponse ] {
3434 instanceCreated := false
3535 var instanceGetResponse * postgresflex.InstanceResponse
3636
3737 handler := wait .New (func () (waitFinished bool , response * postgresflex.InstanceResponse , err error ) {
3838 if ! instanceCreated {
39- s , err := a .GetInstanceExecute (ctx , projectId , instanceId )
39+ s , err := a .GetInstanceExecute (ctx , projectId , region , instanceId )
4040 if err != nil {
4141 return false , nil , err
4242 }
@@ -60,7 +60,7 @@ func CreateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface
6060
6161 // User operations aren't available right after an instance is deemed successful
6262 // To check if they are, perform a users request
63- _ , err = a .ListUsersExecute (ctx , projectId , instanceId )
63+ _ , err = a .ListUsersExecute (ctx , projectId , region , instanceId )
6464 if err == nil {
6565 return true , instanceGetResponse , nil
6666 }
@@ -79,9 +79,9 @@ func CreateInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface
7979}
8080
8181// PartialUpdateInstanceWaitHandler will wait for instance update
82- func PartialUpdateInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , instanceId string ) * wait.AsyncActionHandler [postgresflex.InstanceResponse ] {
82+ func PartialUpdateInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , region , instanceId string ) * wait.AsyncActionHandler [postgresflex.InstanceResponse ] {
8383 handler := wait .New (func () (waitFinished bool , response * postgresflex.InstanceResponse , err error ) {
84- s , err := a .GetInstanceExecute (ctx , projectId , instanceId )
84+ s , err := a .GetInstanceExecute (ctx , projectId , region , instanceId )
8585 if err != nil {
8686 return false , nil , err
8787 }
@@ -106,9 +106,9 @@ func PartialUpdateInstanceWaitHandler(ctx context.Context, a APIClientInstanceIn
106106}
107107
108108// DeleteInstanceWaitHandler will wait for instance deletion
109- func DeleteInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , instanceId string ) * wait.AsyncActionHandler [struct {}] {
109+ func DeleteInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , region , instanceId string ) * wait.AsyncActionHandler [struct {}] {
110110 handler := wait .New (func () (waitFinished bool , response * struct {}, err error ) {
111- s , err := a .GetInstanceExecute (ctx , projectId , instanceId )
111+ s , err := a .GetInstanceExecute (ctx , projectId , region , instanceId )
112112 if err != nil {
113113 return false , nil , err
114114 }
@@ -129,9 +129,9 @@ func DeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInterface
129129}
130130
131131// ForceDeleteInstanceWaitHandler will wait for instance deletion
132- func ForceDeleteInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , instanceId string ) * wait.AsyncActionHandler [struct {}] {
132+ func ForceDeleteInstanceWaitHandler (ctx context.Context , a APIClientInstanceInterface , projectId , region , instanceId string ) * wait.AsyncActionHandler [struct {}] {
133133 handler := wait .New (func () (waitFinished bool , response * struct {}, err error ) {
134- _ , err = a .GetInstanceExecute (ctx , projectId , instanceId )
134+ _ , err = a .GetInstanceExecute (ctx , projectId , region , instanceId )
135135 if err == nil {
136136 return false , nil , nil
137137 }
0 commit comments