-
Notifications
You must be signed in to change notification settings - Fork 522
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
apiclient: add high-level update subcommands #1219
Conversation
474d512
to
b1b25d2
Compare
^ This push uses @etungsten's suggestion to simplify the pretty-printing of check output. I built an AMI and confirmed check output is still so pretty. 💅 |
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.
Nice work!
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.
⛱️
b1b25d2
to
dd1f879
Compare
^ This push addresses @bcressey 's comments. The wait timing still works fine:
|
Issue number:
Hopefully makes #1164 and #1165 no longer pressing, as users won't have to script around apiclient for common use cases.
Description of changes:
There are a number of API calls you have to issue to update a host, generally requiring an outside reference and some scripting, which is more difficult than it should be for such a fundamental task. (If you have access to the admin container, you can use updog directly, but the admin container shouldn't be required on production hosts.)
This aims to simplify updates by adding
update check
,update apply
,update cancel
, andreboot
subcommands to apiclient. You can do everything in one call withapiclient update apply --check --reboot
if desired.Testing done:
apiclient check
by itself gives the update status in JSON (as received from the API, just pretty-printed) which can be used for manual decision-making as required.update apply --check
checks and confirms there's no update available:I then added an update to the repo and applied it OK:
Another apply will tell you it's already done:
cancel
works, and allowed me to do anotherapply
.I ran an apply/cancel loop for nearly 2 hours, which each cycle taking about 10 seconds, or about 720 updates with no issues.
I also ran with
--reboot
, which worked and updated into the new version, and testedapiclient reboot
on its own OK.I confirmed I get the expected "failed to prepare update" when I make an object in my repo private, causing a 403.
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.