-
Notifications
You must be signed in to change notification settings - Fork 165
fix(create): Add helpful error messages for hyphen-prefixed function names mis-parsed as flags #3167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
β¦flags Signed-off-by: RayyanSeliya <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: RayyanSeliya The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @RayyanSeliya. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Codecov Reportβ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3167 +/- ##
==========================================
+ Coverage 59.39% 59.98% +0.59%
==========================================
Files 134 134
Lines 13514 13560 +46
==========================================
+ Hits 8026 8134 +108
+ Misses 4547 4453 -94
- Partials 941 973 +32
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:
|
|
hey @gauron99 can have a look and point me if any tweaks needed ! |
Signed-off-by: RayyanSeliya <[email protected]>
eb60106 to
ce7c1ed
Compare
|
/ok-to-test |
Changes
Adds detection and helpful error messages when function names starting with hyphens (e.g.,
-test-func,--production-func,-123) are mis-parsed as CLI flags. Users now receive clear guidance about DNS-1035 naming rules instead of confusing "template not found" or "unknown flag" errors.Implementation:
wrapFlagParsingError()andwrapFlagParsingErrorWithDetails()helper functions (cmd/errors.go)NewCreateCmd()to intercept Cobra flag parsing errors (cmd/create.go)newInvalidRuntimeError()andnewInvalidTemplateError()to detect mis-parsed names (cmd/create.go)Error Message Example:
/kind bug
Fixes #3166
Release Note