fix: command in karmadactl create should be karmadactl instead of kubectl#7545
fix: command in karmadactl create should be karmadactl instead of kubectl#7545FAUST-BENCHOU wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds richer create subcommand help output by introducing per-subcommand Example strings and wiring a recursive helper to apply them across the cobra command tree.
Changes:
- Added example text blocks for many
createsubcommands (namespace, quota, configmap, RBAC, ingress, secrets, services, etc.). - Introduced a
createSubcommandExampleslookup map keyed by subcommand name. - Added
setCreateSubcommandExamplesto recursively setsubCmd.ExampleduringNewCmdCreate.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| namespaceExample = templates.Examples(` | ||
| # Create a new namespace named my-namespace | ||
| %[1]s create namespace my-namespace`) |
| configMapExample = templates.Examples(` | ||
| # Create a new config map named my-config based on folder bar | ||
| %[1]s create configmap my-config --from-file=path/to/bar |
There was a problem hiding this comment.
no need we have solved it with a no-tty
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive set of example strings for various karmadactl create subcommands and implements a recursive function, setCreateSubcommandExamples, to apply these examples to the command hierarchy. Feedback was provided regarding a formatting bug in the podDisruptionBudgetExample where a percentage sign needs to be escaped to prevent fmt.Sprintf errors. Additionally, it was recommended to add a documentation comment to the new setCreateSubcommandExamples function to align with maintainability best practices.
…ectl Signed-off-by: zhoujinyu <2319109590@qq.com>
53acb8d to
57604bd
Compare
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7545 +/- ##
==========================================
- Coverage 42.08% 42.05% -0.04%
==========================================
Files 879 879
Lines 54619 54625 +6
==========================================
- Hits 22986 22971 -15
- Misses 29911 29927 +16
- Partials 1722 1727 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #7542
Special notes for your reviewer:
Does this PR introduce a user-facing change?: