-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix crash with targets show #303
Conversation
`fioctl targets show ""` causes the tool to crash. This helps it fail more cleanly. Signed-off-by: Andy Doan <andy@foundries.io>
discovered by a customer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still puzzled about why cobra did not catch this.
Does it mean that a dozen of other commands can fail on this too?
I think we probably have to set minlen for string args that require it
…On Fri, Oct 6, 2023, 5:59 PM vkhoroz ***@***.***> wrote:
***@***.**** approved this pull request.
I am still puzzled about why cobra did not catch this.
Does it mean that a dozen of other commands can fail on this too?
—
Reply to this email directly, view it on GitHub
<#303 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABXSJAZDQQE6A6QMIKJSETX6CEOJAVCNFSM6AAAAAA5WLF4H6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTMNRSHA4TAOJTHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@doanac I'm kind of fine with this as a quick fix for the exact problem. Still, I'm a bit of worried about the generic use case: that we might end up fixing a few dozen of places like this here and there. TL;DR The next idea is to put that check somewhere in the root command: https://github.com/foundriesio/fioctl/blob/main/cmd/root.go#L42 like below:
This way, every single command is covered by this check uniformly, and we don't need to worry about empty values anymore. |
@vkhoroz works for me. I'm not going to have a lot of time to hack this week. you want to close this out and push your own fix? |
@doanac ok, let me try to craft smth by EOW. Then I will close this PR. |
Closing this in favor of a more generic fix to all commands: #312 |
fioctl targets show ""
causes the tool to crash. This helps it fail more cleanly.