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
Helm does not error on typo or missing sub-command #8268
Comments
Helm 3.2.3 uses cobra 1.0.0, which should contain the fix. cobra 1.0 was released in April. That PR you linked to appears to have been merged in August 2019, so it should be in the 1.0 release. If you can pinpoint where in the codebase that may be causing the issue, we'd appreciate the help. |
I've replicated the issue on the tip of master which runs cobra 1.0.0. Any pointers to what's causing the issue or pull requests with a fix are welcome. |
If allowed, I can understand the problem and try to fix it |
feel free |
/assign |
The Cobra fix in question was reverted in spf13/cobra#1068. |
This is now fixed on the tip of master so I'm going to close the issue. |
@mattfarina Is this really fixed on master or was there a mixup in which issue you mean to close? |
After speaking at the helm dev call, we agreed to re-open if the problem could be reproduced, so:
As we can see an invalid command below |
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs. |
Output of
helm version
: version.BuildInfo{Version:"v3.2.3", GitCommit:"8f832046e258e2cb800894579b1b3b50c2d83492", GitTreeState:"clean", GoVersion:"go1.13.12"}Output of
kubectl version
: n/aCloud Provider/Platform (AKS, GKE, Minikube etc.): n/a
When issuing a helm command, helm returns success on typos.
For example "helm repo sadd foo https://foo/bar" will show the help for "helm repo" but exit code will be 0 (success) rather than non-zero (failure)
This prevents tools from correctly identifying an error happened.
The fix for cobra command line parsing to correctly fix the problem they had is in spf13/cobra#922 and has been in master for over half a year now.
Could we please get helm to fix this.
(This would also then match most commands that fail when typos or missing sub-commands are given.)
Note that git acts correctly - it will provide help if you mistype a command but it will be an error unless you specifically asked for help.
For example, just "git" shows the help but has an exit code of non-zero (1). But "git --help" shows the help with an exit code of 0 (success) in that it did what you asked it to.
The text was updated successfully, but these errors were encountered: