-
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-1542] Fix run actions on units #698
Conversation
Rerun tests after merging #697 |
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
/merge |
I'm now getting
Not sure if it's because of this change. |
@sed-i It's for sure because of this change, but afaik the juju |
Oh nice, I didn't know. BTW would it be easy for pylibjuju to raise a runtime error if the controller version is too old? |
We have not decided so far the list of Juju controllers to be supported by every pylibjuju version. But that makes perfect sense. |
#704 Tuesday August 9 2022 ## What's Changed Switching to semantic versioning. From this release on, at least the major release number matches the most recent Juju supported. Hence the jump to `3.0.0` since this release supports `Juju 3.0`. (This also means that `python-libjuju <= 2.9.11` only support up to `Juju 2.x`) * [JUJU-1439] Initial fixes for `test_model` to pass with juju 3.0 by @cderici in #689 * [JUJU-1464] More fixes for 3.0 compatibility by @cderici in #691 * [JUJU-1457] Merge 3.0 compatibility branch onto master by @cderici in #692 * Fix conditional by @sed-i in #696 * [JUJU-1534] Fix `model.connect_current()` by @cderici in #697 * [JUJU-1542] Fix run actions on units by @cderici in #698 * [JUJU-1577] Replace k8s bundles with machine bundles for tests by @cderici in #703 * [JUJU-1528] Add storage implementation by @cderici in #701 [JUJU-1439]: https://warthogs.atlassian.net/browse/JUJU-1439?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-1464]: https://warthogs.atlassian.net/browse/JUJU-1464?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-1457]: https://warthogs.atlassian.net/browse/JUJU-1457?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-1534]: https://warthogs.atlassian.net/browse/JUJU-1534?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-1542]: https://warthogs.atlassian.net/browse/JUJU-1542?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-1577]: https://warthogs.atlassian.net/browse/JUJU-1577?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-1528]: https://warthogs.atlassian.net/browse/JUJU-1528?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
#706 #### Description This change attempts to fix the `Unit.run_actions` issue where the resulting object is different based on the used Facade (which is based on whether the `2.9` or `3.0` juju client is being used). With this change both ways will return the same type of object as a result of running the action on the unit. It's also a continuation/possible-regression-fix of #698. Also adding the `EnvironUpgrader` facade that's introduced in `Juju 3.0`, so we shouldn't get the "unexpected facade" warning anymore. Also updating the clients with the latest schema from juju 3.0. In particuılar the Application facade version is bumped up `13` -> `14`. With this #705 should be fixed too. #### QA Steps QA steps for this is sort of a simulation of one of the real world libjuju uses in a function on [mongodb-operator](https://github.com/canonical/mongodb-operator/blob/8796be02e10b84f990da0426ad1cff5922dc506a/tests/integration/helpers.py#L39). Get a controller on a k8s cloud (I did it on `microk8s`). The following then should work fine. Full QA should be done with 2 separate controllers (at least that's what I did): one bootstrapped with `juju 2.9` and another with `juju 3.0`. ```python async def _get_password(): model = Model() await model.connect() await model.deploy('zinc-k8s') await model.wait_for_idle(status="active") unit = model.applications['zinc-k8s'].units[0] action = await unit.run_action("get-admin-password") action = await action.wait() print(action.results["admin-password"]) await model.disconnect() ``` #### Notes & Discussion This is also related (and most likely a fix) to: * openstack-charmers/zaza#545 * openstack-charmers/zaza#546 * https://github.com/canonical/mongodb-operator/runs/7761747331?check_suite_focus=true
Description
This changes the function that's used for running an action on a unit from
Action.Enqueue
toAction.EnqueueOperation
, because it's the most up to date one and also the former one is deprecated inAction v7
facade.model.connect_current()
#697 has landed.QA Steps
The qa steps I followed were with a k8s model. So get a controller on a k8s cloud.
The following then should work fine.
Notes & Discussion