-
Notifications
You must be signed in to change notification settings - Fork 657
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
Wrong parameter parsing #2224
Comments
Hey @luis4a0, Thanks for entering this. For the expected behavior, I'm not sure if this is what you meant, but For example, it's possible someone may enter |
The fact that Now I see it's not a trivial fix. We need to parse in two stages (analogous to lex and yacc): first we generate tokens from all the options in the command line (that is, one for each unit separated by spaces) and then we parse the those tokens, combined in the order given. Maybe there is a simpler way to do it, I'll think about it. |
Hey @luis4a0, ok, cool. It should actually be quite trivial to fix. In |
Perhaps this could be dealt with in the client: confirm it is a valid MemorySize before adding it to the request. That's already done for CPUs. |
Thanks for your insights @townsend2010 and @ricab! I implemented the latter, it proved to be easier. In fact, I didn't remove check code for the daemon because it is still needed to check that the requested size is bigger than the minimum. |
You also can't trust the client to have done the validation :) |
Yep, the daemon of course needs to validate the contents of RPC requests (to be sure, I did not mean to suggest otherwise). |
Describe the bug
Issuing
multipass launch -n asdf -mem 2048M
givesExpected behavior
-mem
should be recognized as a wrong parameter, before checking the validity of2048M
as an alias.The text was updated successfully, but these errors were encountered: