Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Release (2025-XX-XX)

- `postgresflex`: [v1.0.1](services/postgresflex/CHANGELOG.md#v101-2025-03-12)
- **Bugfix:** `DeleteUserWaitHandler` is now also using the region as parameter.

## Release (2025-03-05)

- `core`: [v0.16.1](core/CHANGELOG.md#v0161-2025-02-25)
Expand Down
3 changes: 3 additions & 0 deletions services/postgresflex/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v1.0.1 (2025-03-12)
- **Bugfix:** `DeleteUserWaitHandler` is now also using the region as parameter.

## v1.0.0 (2025-02-24)
- **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.

Expand Down
6 changes: 3 additions & 3 deletions services/postgresflex/wait/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type APIClientInstanceInterface interface {

// Interface needed for tests
type APIClientUserInterface interface {
GetUserExecute(ctx context.Context, projectId, instanceId, userId string) (*postgresflex.GetUserResponse, error)
GetUserExecute(ctx context.Context, projectId, region, instanceId, userId string) (*postgresflex.GetUserResponse, error)
}

// CreateInstanceWaitHandler will wait for instance creation
Expand Down Expand Up @@ -149,9 +149,9 @@ func ForceDeleteInstanceWaitHandler(ctx context.Context, a APIClientInstanceInte
}

// DeleteUserWaitHandler will wait for delete
func DeleteUserWaitHandler(ctx context.Context, a APIClientUserInterface, projectId, instanceId, userId string) *wait.AsyncActionHandler[struct{}] {
func DeleteUserWaitHandler(ctx context.Context, a APIClientUserInterface, projectId, region, instanceId, userId string) *wait.AsyncActionHandler[struct{}] {
handler := wait.New(func() (waitFinished bool, response *struct{}, err error) {
_, err = a.GetUserExecute(ctx, projectId, instanceId, userId)
_, err = a.GetUserExecute(ctx, projectId, region, instanceId, userId)
if err == nil {
return false, nil, nil
}
Expand Down
4 changes: 2 additions & 2 deletions services/postgresflex/wait/wait_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type apiClientUserMocked struct {
isUserDeleted bool
}

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

handler := DeleteUserWaitHandler(context.Background(), apiClient, "", "", userId)
handler := DeleteUserWaitHandler(context.Background(), apiClient, "", "", "", userId)

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

Expand Down
Loading