pd-ctl: keyspace-group support set show keyspaces - #11208
Conversation
Signed-off-by: ystaticy <y_static_y@sina.com> (cherry picked from commit 84d1fcb3a39aff3422c6729dd322d6bcf0d89d8d)
Signed-off-by: ystaticy <y_static_y@sina.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe ChangesKeyspace group output
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~15 minutes Merge Risk: ⚪ Minimal · up to Keyspace-group output includes keyspaces by default and hides them only when requested, consistently across supported output modes. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai[bot]: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: coderabbitai[bot] The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #11208 +/- ##
==========================================
+ Coverage 79.35% 79.73% +0.37%
==========================================
Files 542 545 +3
Lines 76993 78913 +1920
==========================================
+ Hits 61097 62918 +1821
- Misses 11594 11620 +26
- Partials 4302 4375 +73
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
/test pull-unit-test-next-gen-2 |
| testutil.Eventually(re, func() bool { | ||
| output, err := tests.ExecuteCommand(cmd, append(args, defaultKeyspaceGroupID)...) | ||
| re.NoError(err) | ||
| re.Contains(string(output), "\"keyspaces\"") |
There was a problem hiding this comment.
testutil.Eventually runs this callback in a polling goroutine, while require.Contains and require.NoError call FailNow. If the keyspace-group manager is still initializing and this request temporarily returns a non-JSON error—a state the helper below explicitly retries—the callback exits before returning false; the test is marked failed and then waits for the Eventually timeout instead of retrying, making the new integration test flaky.
Signed-off-by: ystaticy <y_static_y@sina.com>
|
/retest-required |
|
/test pull-unit-test-next-gen-3 |
| } | ||
|
|
||
| func convertToKeyspaceGroups(content string) string { | ||
| func convertToKeyspaceGroups(content string, showKeyspaces bool) string { |
There was a problem hiding this comment.
How about implementing it on the server side? The response body may be very large if the keyspace count is too large.
What problem does this PR solve?
pd-ctl keyspace-groupincludes the keyspace ID list in its output by default. For keyspace groups with many keyspaces, this can make the output unnecessarily long. This PR adds an option to hide the keyspace ID list when a more concise output is preferred, while preserving the existing default behavior.Issue Number: Close #11207
What is changed and how does it work?
--hide-keyspacesflag topd-ctl keyspace-group.keyspacesfield by default for both single-keyspace-group and list output.--hide-keyspaces=trueto omit thekeyspacesfield from the output.keyspacesfield is included or omitted consistently without changing the source API response.Check List
Tests
Release note
Summary by CodeRabbit
New Features
--hide-keyspacesoption to omit keyspace lists from keyspace-group command output.Bug Fixes