-
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
Bundles with overlays #566
Conversation
!!build!! |
d54f56a
to
d4bc0f2
Compare
…i-yaml #13448 ### Description `pylibjuju` uses the bundle facade to get the changes for a bundle to be deployed. However, currently the `GetChanges` function that the facade uses only handles single-part yaml files, so this PR adds the support for multi-part yaml handling (which the Juju cli uses) to enable the use of overlays in bundles. ### QA steps ```sh $ cd juju/apiserver/facades/client/bundle/ $ go test -gocheck.f TestGetChangesWithOverlaysV6 $ go test -gocheck.f TestGetChangesWithOverlaysV1_5 ``` ### Notes & Discussion This PR is needed for juju/python-libjuju#566, which adds the support for overlays in deploying bundles.
juju/bundle.py
Outdated
@@ -152,14 +156,63 @@ async def _handle_local_charms(self, bundle, bundle_dir): | |||
app_name, | |||
charm_url, | |||
utils.get_local_charm_metadata(charm_dir), | |||
resources=bundle["applications"][app_name].get("resources", {}), | |||
resources=bundle.get('applications', bundle.get('services', {}))[app_name].get("resources", {}), |
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.
Services are dead to us, we shouldn't introduce deprecated functionality.
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'm pretty sure I added that because a bundle had 'services' but not 'applications', but maybe it was because of the facade versions etc.
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.
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 turns out I copy/pasted some old bundles to make new test bundles and introduced them myself, I updated all of them, running local tests right now, gonna push the patch soon 👍
juju/bundle.py
Outdated
|
||
""" | ||
bundle_apps = [self.bundle.get('applications', self.bundle.get('services', {}))] | ||
overlay_apps = [overlay.get('applications', self.bundle.get('services', {})) for overlay in self.overlays] |
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.
Same as above, remove services.
@@ -0,0 +1,15 @@ | |||
series: xenial | |||
services: |
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.
☝️
Note for the CI fails: The tests included in this PR are expected to fail in the CI because this PR depends on that PR on Juju which is landed, but not in the release yet, and the CI tests don't use the HEAD of Juju, it |
490030c
to
33f3f37
Compare
|
#599 2.9.5 ^^^^^ Friday December 3 2021 * remove the event loop arguments by @cderici in #560 * add debug-log by @cderici in #562 * Model status by @juanmanuel-tirado in #563 * Pin cffi version to 1.14.6 for Python 3.5 by @cderici in #570 * Wait for applications to terminate on model reset by @balbirthomas in #572 * Babysitting python3.5 by @cderici in #571 * Deploy charmhub bundles by @cderici in #569 * Facade schemas for 2.9.17 by @SimonRichardson in #579 * Bundles with overlays by @cderici in #566 * Consistently getting a unit's public address by @cderici in #573 * [JUJU-158] Add python3.9 to setup.py by @cderici in #585 * [JUJU-157] Add note for removing services by @cderici in #583 * Added boolean entries to normalize values. by @juanmanuel-tirado in #582 * [JUJU-138] Streamlining asyncio tasks/events by @cderici in #580 * [JUJU-234] Fix for small bug in task handling by @cderici in #589 * Ensure all watchers validate for the Id by @SimonRichardson in #592 * [JUJU-276] Facade schemas for 2.9.19 by @cderici in #594 * [JUJU-238] Small bug fix for old ClientFacade support by @cderici in #593 * [JUJU-239] Debug-log parameters by @cderici in #595 * [JUJU-213] Local type `file` resource support by @cderici in #590 * [JUJU-289] Use provided series in deploy if supported by @jack-w-shaw in #596 * [JUJU-292] Update the charms in the tests to use Charmhub by @cderici in #597 * Legacy "services" for describing "applications" within bundles are no longer supported. "applications" can be used as a direct replacement for "services" in bundles.yaml. * The websocket (ws) in a Connection object became a read-only property. [JUJU-293] [JUJU-158]: https://warthogs.atlassian.net/browse/JUJU-158?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Description
This PR adds the support for overlays in bundle deployments.
Fixes #510
This PR relies on a change in Juju's api for getting changes for bundles with overlays (multi-part yaml support), juju/juju#13448.
Jira card #142
QA Steps
tests/integration/test_model.py
includes some new tests for the added support.Notes & Discussion
Please do not merge yet, as a couple of small things need to be done/added for this to be ready to land:
GetChange
add multi-part yaml support to GetChanges for the bundle facade juju#13448--overlay
argument, along with its test--overlay
argument to a local bundle being deployed--overlay
argument to a charmstore bundle being deployedconfig: include-file://
andconfig: include-base64://
here inpylibjuju
side