-
Notifications
You must be signed in to change notification settings - Fork 736
Add --zone argument to launch command #4011
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
Conversation
25fc219 to
a4bb060
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## az-enable-disable-commands #4011 +/- ##
==============================================================
- Coverage 87.51% 87.46% -0.05%
==============================================================
Files 268 268
Lines 15149 15162 +13
==============================================================
+ Hits 13258 13262 +4
- Misses 1891 1900 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
16ac95a to
882f19a
Compare
8c3639e to
51b2112
Compare
043edde to
d91dc99
Compare
7ec3ba7 to
fa9880f
Compare
51b2112 to
3b065cc
Compare
fa9880f to
badabe0
Compare
3b065cc to
e55f30d
Compare
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.
Hey, @levkropp! I have just a few small comments. Besides those, I see that some of the changes are just formatting changes to code that you did not touch, perhaps it was formatted automatically. Could you make sure that you only format code that actually changed?
d619572 to
b86caf2
Compare
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.
Much better. But during functional testing I saw some small issues.
If I pass an invalid/unavailable zone to --zone, I get a generic error message launch failed: Invalid arguments supplied. So you'll need to add extra checks for the type of error we get back. The grpc reply should contain the error codes already, you just need to turn them into nice messages. You could add something like
else if (error == LaunchError::INVALID_ZONE)
{
error_details = fmt::format("Invalid zone name supplied: {}", request.zone());
}
else if (error == LaunchError::ZONE_UNAVAILABLE)
{
error_details = fmt::format("Unavailable zone name supplied: {}", request.zone());
}to the existing if-else chain that checks other LaunchError codes.
b86caf2 to
5c7a9b6
Compare
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.
Yup, looks good to me now! Thanks, @levkropp!
This pull request includes several changes to improve the
launchcommand functionality in thesrc/client/cli/cmd/launch.cppfile, focusing on code formatting and adding a new--zoneoption. Additionally, it includes updates to the daemon and tests to support the new functionality.New
--zoneoption:src/client/cli/cmd/launch.cpp: Added a new--zoneoption to specify the availability zone during the launch command. This includes parsing the new option and setting the zone in the request. [1] [2]src/daemon/daemon.cpp: Updated the daemon to handle the new zone information and include it in the response. [1] [2]src/rpc/multipass.proto: Added a newzone_namefield to theLaunchReplymessage to communicate the zone information.Test updates:
tests/test_cli_client.cpp: Added new tests to verify the functionality of the--zoneoption, including tests for valid, empty, and nonexistent zone values.