diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b41dedca..2d152fc9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/services/postgresflex/CHANGELOG.md b/services/postgresflex/CHANGELOG.md index 11b197294..7603fb673 100644 --- a/services/postgresflex/CHANGELOG.md +++ b/services/postgresflex/CHANGELOG.md @@ -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. diff --git a/services/postgresflex/wait/wait.go b/services/postgresflex/wait/wait.go index ec4d61c07..2abf1af74 100644 --- a/services/postgresflex/wait/wait.go +++ b/services/postgresflex/wait/wait.go @@ -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 @@ -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 } diff --git a/services/postgresflex/wait/wait_test.go b/services/postgresflex/wait/wait_test.go index 57e6b4311..fc87463f3 100644 --- a/services/postgresflex/wait/wait_test.go +++ b/services/postgresflex/wait/wait_test.go @@ -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, @@ -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())