Skip to content
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

[v24.1.x] rpk: add error for unknown command execution #18676

Merged

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #18650
Fixes: #18675,

Cobra won't recognize unknown commands unless
cobra.NoArg is set as an Arg validation parameter
in the command definition.

This means that running 'rpk cluster unknowncommand'
won't return a 'unknown command' error, therefore,
exit as a successful command execution.

Now, cobra will return an 'unknown error' and exit
with code 1.

(cherry picked from commit d1e7f6a)
@vbotbuildovich vbotbuildovich added this to the v24.1.x-next milestone May 27, 2024
@vbotbuildovich vbotbuildovich requested a review from twmb as a code owner May 27, 2024 13:58
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label May 27, 2024
@r-vasquez r-vasquez merged commit 3e764ea into redpanda-data:v24.1.x May 27, 2024
23 checks passed
@BenPope BenPope modified the milestones: v24.1.x-next, v24.1.4 May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rpk kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants