-
Notifications
You must be signed in to change notification settings - Fork 83
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
kubeletctl panics when no arguments are provided to some commands #5
Comments
Thanks ! I will fix it and update, but you can still use the If you will run
Example for
So a valid
Or
|
@jimen0 thank you for reporting this issue :) I tested it for the two commands you said and now it is fixed in version v1.5. |
kubeletctl
commands that require arguments cause apanic
if no arguments are provided. I confirmed this behaviour with this release.Panic comes from the following snippet:
The error comes from checking if the arguments slice is nil instead of checking the number of arguments (length of a nil slice is 0 too, see the playground). If no arguments are provided,
cobra
passes an empty slice as argument, notnil
.I confirmed this behaviour in the
debug
andexec
commands, but it might be present in more of them.I built this small repro so you can check
cobra
's behaviour when no arguments are provided:Regards,
Miguel
The text was updated successfully, but these errors were encountered: