-
Notifications
You must be signed in to change notification settings - Fork 736
[cli] add enable/disable-zones commands #3926
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
6ed85d3 to
61f8197
Compare
312f88b to
383d688
Compare
61f8197 to
a8dfbc5
Compare
383d688 to
3e0da18
Compare
a8dfbc5 to
4f5405a
Compare
3e0da18 to
0a4ee8e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## availability-zones #3926 +/- ##
======================================================
+ Coverage 89.24% 89.50% +0.25%
======================================================
Files 265 267 +2
Lines 15050 15177 +127
======================================================
+ Hits 13432 13584 +152
+ Misses 1618 1593 -25 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
LGTM
4f5405a to
da81d8c
Compare
0a4ee8e to
601c7af
Compare
da81d8c to
252c179
Compare
601c7af to
043edde
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 @andrei-toterman, looks good overall. Only small comments and nitpicks.
8b07126 to
78e9b91
Compare
043edde to
d91dc99
Compare
d91dc99 to
7ec3ba7
Compare
089be1d to
e859b3f
Compare
7ec3ba7 to
fa9880f
Compare
e859b3f to
848b4c3
Compare
fa9880f to
badabe0
Compare
989f543 to
382dfca
Compare
479d1b2 to
d22e267
Compare
d22e267 to
d3c57b4
Compare
9cc4b22 to
c7e2314
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.
I finally managed to get back to this. It is shaping up nicely and getting close, but there are a few things with respect to --all and arguments that need attention.
Also, as discussed elsewhere, there is quite a bit of missing coverage (I thought this was covered by tests in a different branch, but it turns out that is not the case.)
506dbd9 to
affecab
Compare
affecab to
e1b367e
Compare
677c275 to
3ecc556
Compare
c623e24 to
bf18f23
Compare
bf18f23 to
c2a338e
Compare
f604edd to
5a32132
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.
Looking good @levkropp, good job!
I ended up being a proper primary review and I have a few very small fixes inline, but I am going ahead and pre-approving. You'll need a green stamp from @xmkg when you push again, then feel free to merge.
Missing bash completion, but you can add that in a separate PR.
src/client/cli/cmd/disable_zones.cpp
Outdated
| return ParseCode::Ok; | ||
| } | ||
|
|
||
| bool DisableZones::confirm() |
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.
This could be const, right?
src/daemon/daemon.cpp
Outdated
| if (request->zones().empty()) | ||
| { | ||
| config->az_manager->get_zone(zone_name).set_available(request->available()); | ||
| auto& az_manager = *config->az_manager; |
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.
If you want to keep this, better extract it outside the if and use it in both branches homogeneously.
src/client/cli/cmd/disable_zones.cpp
Outdated
|
|
||
| QString DisableZones::description() const | ||
| { | ||
| return QStringLiteral("Makes the given availability zones unavailable. Instances therein are" |
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.
| return QStringLiteral("Makes the given availability zones unavailable. Instances therein are" | |
| return QStringLiteral("Makes the given availability zones unavailable. Instances therein are " |
|
|
||
| const auto on_failure = [this, &spinner](const grpc::Status& status) { | ||
| spinner.stop(); | ||
| return standard_failure_handler_for(name(), cerr, status); |
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.
If I use a bad AZ, I get this error message:
$ multipass enable-zones asdf
enable-zones failed: no AZ with name "asdf" found
Could we have another PR to avoid "AZ" in messages to the user? Let's stick to "zone" as a single nomenclature. "Availability zone" in the help text and docs is fine though IMO.
This PR adds the CLI commands `enable-zones` and `disable-zones` which send the gRPC calls for making an AZ available or unavailable. MULTI-1872
This PR adds the CLI commands
enable-zonesanddisable-zoneswhich send the gRPC calls for making an AZ available or unavailable.MULTI-1872