-
Notifications
You must be signed in to change notification settings - Fork 102
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
[JUJU-367] Improve get_charm_series
to check the model for series for a local charm
#607
Conversation
get_charm_series
to check the model for series for a local charmget_charm_series
to check the model for series for a local charm
examples/upgrade_local_charm_k8s.py
Outdated
|
||
1. Connects to the current model | ||
2. Deploy a bundle and waits until it reports itself active | ||
3. Destroys the units and applications |
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.
Missing: upgrades the charm from local path.
juju/bundle.py
Outdated
|
||
if series is None: | ||
model_config = await model.get_config() | ||
default_series = model_config.get("default-series") |
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.
In my case I have a k8s charm, but the "default-series" it has stored is:
<ConfigValue source='default' value='focal'>
Is that normal?
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.
Yeah that's normal, that's why we get the .value
out of it (#L440), but we need to check if it's None
first, though maybe I can make the coding a bit clearer there.
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.
LG2M
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.
LG2M
!!build!! |
|
#619 ## What's Changed * [JUJU-320] Unit public address by @SimonRichardson in #600 * [JUJU-244] Add attach-resource by @cderici in #601 * [JUJU-140] Model.wait_for_idle -- for apps with no units yet by @cderici in #575 * [JUJU-367] Improve `get_charm_series` to check the model for series for a local charm by @cderici in #607 * [JUJU-366] Utility for connecting directly to existing connection by @cderici in #605 * Use public-address key instead of public_address by @wolsen in #610 * [JUJU-376] `wait_for_idle` to support scale down by @cderici in #613 * [JUJU-378] Utility for block_until-ing with a custom coroutine by @cderici in #614 * Fallback to 'local-fan' by @dparv in #612 * Minor comments on docs for block_until related functions. by @juanmanuel-tirado in #617 * Additional checks in print status. by @juanmanuel-tirado in #622 ## New Contributors * @wolsen made their first contribution in #610 * @dparv made their first contribution in #612 [JUJU-320]: https://warthogs.atlassian.net/browse/JUJU-320?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-244]: https://warthogs.atlassian.net/browse/JUJU-244?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-140]: https://warthogs.atlassian.net/browse/JUJU-140?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-367]: https://warthogs.atlassian.net/browse/JUJU-367?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-366]: https://warthogs.atlassian.net/browse/JUJU-366?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-376]: https://warthogs.atlassian.net/browse/JUJU-376?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-378]: https://warthogs.atlassian.net/browse/JUJU-378?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Description
get_charm_series
method for a local charm extracts theseries
information for a local charm. It's often called from the_handle_local_charms
from within the bundle.py when deploying local charms, which handles the case where no series information found by also checking the model config data.The
get_charm_series
is also called fromapplication.py
inrefresh (upgrade_charm)
method, which doesn't handle the "no series" case.This PR moves that logic (of also checking the model for series info) into the
get_charm_series
by adding an additional model parameter. So, whichever entity that's calling theget_charm_series
also provides the associated model and need to do nothing else.Fixes #606
QA Steps
Also related:
This one ☝️ is using machine charms and was already passing before this PR too.
Notes & Discussion