fix: pagination on describe accounts in postgresql#4211
Open
cattyman919 wants to merge 2 commits into
Open
Conversation
Author
|
Note: Its seem the pagination issue only happens when fetching postgres accounts. Other database fetching methods seems to work fine. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add pagination to describe accounts postgresql service.
Why
The problem relates to tencentcloud_postgresql_account where it only read the first 20 user in a database instance when checking with the current tfstate.
the function TencentCloudPostgresqlAccountRead is not able to capture all of the users above 20 users in a single database instance. Hence it will return an empty user if the user index is above 20 even though the user exists in the database instance.
Related Problems
I've realized similar function in different database type also doesn't handle pagination as well.
DescribeMongodbInstanceAccountById:terraform-provider-tencentcloud/tencentcloud/services/mongodb/service_tencentcloud_mongodb.go
Lines 572 to 604 in 1cf5f7f
DescribeCynosdbAccountById:terraform-provider-tencentcloud/tencentcloud/services/cynosdb/service_tencentcloud_cynosdb.go
Lines 2063 to 2092 in 1cf5f7f
DescribeCynosdbAccountsByFilter:terraform-provider-tencentcloud/tencentcloud/services/cynosdb/service_tencentcloud_cynosdb.go
Lines 906 to 938 in 1cf5f7f
Let me know if you also want me to make changes as well to those other databases to implement pagination.
Type of change
Checklist
make buildsucceeds locallymake fmtproduces no diffmake lintpasses (or pre-existing failures are unrelated)make check-muxpasses (SDKv2 + framework mux compatibility)registered in the other stack (CI's
make check-muxenforcesthis; please double-check before opening the PR)
website/docs/r/orwebsite/docs/d/go.modchanges are accompanied bygo mod vendorin the same commit.changelog/<PR>.txt(if user-facing)Notes for reviewers