Skip to content

Commit 0092424

Browse files
authored
Bugfix: DeleteUserWaitHandler of postgresql was missing the region adjustment (#1555)
Signed-off-by: Alexander Dahmen <[email protected]>
1 parent 43872f8 commit 0092424

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Release (2025-XX-XX)
2+
3+
- `postgresflex`: [v1.0.1](services/postgresflex/CHANGELOG.md#v101-2025-03-12)
4+
- **Bugfix:** `DeleteUserWaitHandler` is now also using the region as parameter.
5+
16
## Release (2025-03-05)
27

38
- `core`: [v0.16.1](core/CHANGELOG.md#v0161-2025-02-25)

services/postgresflex/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v1.0.1 (2025-03-12)
2+
- **Bugfix:** `DeleteUserWaitHandler` is now also using the region as parameter.
3+
14
## v1.0.0 (2025-02-24)
25
- **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request.
36

services/postgresflex/wait/wait.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type APIClientInstanceInterface interface {
2626

2727
// Interface needed for tests
2828
type APIClientUserInterface interface {
29-
GetUserExecute(ctx context.Context, projectId, instanceId, userId string) (*postgresflex.GetUserResponse, error)
29+
GetUserExecute(ctx context.Context, projectId, region, instanceId, userId string) (*postgresflex.GetUserResponse, error)
3030
}
3131

3232
// CreateInstanceWaitHandler will wait for instance creation
@@ -149,9 +149,9 @@ func ForceDeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInte
149149
}
150150

151151
// DeleteUserWaitHandler will wait for delete
152-
func DeleteUserWaitHandler(ctx context.Context, a APIClientUserInterface, projectId, instanceId, userId string) *wait.AsyncActionHandler[struct{}] {
152+
func DeleteUserWaitHandler(ctx context.Context, a APIClientUserInterface, projectId, region, instanceId, userId string) *wait.AsyncActionHandler[struct{}] {
153153
handler := wait.New(func() (waitFinished bool, response *struct{}, err error) {
154-
_, err = a.GetUserExecute(ctx, projectId, instanceId, userId)
154+
_, err = a.GetUserExecute(ctx, projectId, region, instanceId, userId)
155155
if err == nil {
156156
return false, nil, nil
157157
}

services/postgresflex/wait/wait_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type apiClientUserMocked struct {
6262
isUserDeleted bool
6363
}
6464

65-
func (a *apiClientUserMocked) GetUserExecute(_ context.Context, _, _, _ string) (*postgresflex.GetUserResponse, error) {
65+
func (a *apiClientUserMocked) GetUserExecute(_ context.Context, _, _, _, _ string) (*postgresflex.GetUserResponse, error) {
6666
if a.getFails {
6767
return nil, &oapierror.GenericOpenAPIError{
6868
StatusCode: 500,
@@ -383,7 +383,7 @@ func TestDeleteUserWaitHandler(t *testing.T) {
383383
isUserDeleted: !tt.deleteFails,
384384
}
385385

386-
handler := DeleteUserWaitHandler(context.Background(), apiClient, "", "", userId)
386+
handler := DeleteUserWaitHandler(context.Background(), apiClient, "", "", "", userId)
387387

388388
_, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background())
389389

0 commit comments

Comments
 (0)