-
Notifications
You must be signed in to change notification settings - Fork 510
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
Merge 2.9 into develop #13565
Merged
Merged
Merge 2.9 into develop #13565
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
of *charm.URL. There is an overhead for parsing the stored URL, which we are paying whether we access it or not.
Include the application name to point user in the correct direction. With bundle handling, any number of applications could cause the problem. LP 1931739.
Help with debugging later by using the required logger in ChangeConfig if the model doesn't have one.
Fix for LP 1950237. Old controllers have the charm channel data, but do not include it in FullStatus results. It is available in ApplicationInfo. Covers cases where bundles are exported from old controllers, edited to include a channel, and deployed with newer clients. There may be others.
Existing model data now ensures that the channel is provided, to correctly determine if the bundle is attempting an upgrade by channel, assume a stable channel if none is provided in the bundle. Unit tests updated to include data as current controllers will return.
Include the application name so the person deploying the bundle has a starting point to fix the error.
…y with 2.9 < controllers
Allow the order of arguments to change from the expected alphabeticial ordering. Update the response appropriately too.
…ller juju#13556 Fix 1950237 by using ApplicationsInfo to find existing channels, rather than the status output, which doesn't contain the data in pre-2.9 controllers. This will only be done for pre 2.9 controllers, as is the case when the defaultCharmSchema is charmstore. Nicely, ApplicationsInfo is a bulk api call. However this necessitated requiring applications to have a channel from the bundle. To keep compatibility assume stable if channel not specified in the bundle. Fix 1931739 by updating the error messages to include the application name causing the failure. Helps finding the problem in the bundle, where multiple applications exist. Now that ChangeConfig is internal to juju, ensure there is always a logger. ## QA steps Please try various combinations of juju clients and controllers with deploying bundles and redeploying them with --dry-run to ensure no changes. Below are reproducers for the bugs resolved. ```console $ sudo snap refresh juju --channel 2.8/stable # using the snap juju: $ juju bootstrap localhost two-eight $ juju deploy cs:~ubuntu-mirror-charm-maintainers/ubuntu-mirror Located charm "cs:~ubuntu-mirror-charm-maintainers/ubuntu-mirror-9". Deploying charm "cs:~ubuntu-mirror-charm-maintainers/ubuntu-mirror-9". $ juju deploy cs:~ubuntu-mirror-charm-maintainers/ubuntu-mirror --channel candidate ubuntu-mirror-candidate Located charm "cs:~ubuntu-mirror-charm-maintainers/ubuntu-mirror-9". Deploying charm "cs:~ubuntu-mirror-charm-maintainers/ubuntu-mirror-9". $ juju export-bundle > /tmp/bundle.yaml # edit the bundle to include the candidate channel for ubuntu-mirror-candidate # with the 2.9 client: $ juju deploy /tmp/bundle.yaml --dry-run No changes to apply. ``` ## Bug reference https://bugs.launchpad.net/juju/+bug/1950237 https://bugs.launchpad.net/juju/+bug/1931739
Increment juju to 2.9.23
was at the time (version 2.8) that stored *charm.URL instead of *string.
juju#13546 We have long stored in the unit Mongo document, an actual `*charm.URL` reference. This of course is fraught with danger, as upstream changes to the library can change what is stored, and potentially render old documents incompatible with an updated type. In addition, we instituted `GetBSON` and `SetBSON` helpers to handle persistence and retrieval, which were made non-trivial by the introduction of CharmHub and multiple possible formats for this URL. We have ended up in a situation where we are paying a small overhead to parse this URL upon every access, even when we might not use the field. Here we update the document to store a string, and only parse the URL at need. The patch is scoped only to what is necessary to change the one field in the unit document. We still do unnecessary conversion, and could benefit from changing the application document as well, including all the sundry methods that accept `*charm.URL`, but immediately stringify it for use. Upgrades had one usage of the doc for a version 2.8 step. This is replaced with the old version of the doc still storing a `*charm.URL`. ## QA steps - Bootstrap a 2.7 controller and `juju install ubuntu -n 3`. - With this patch, `juju upgrade-controller --build-agent`. - Run `juju upgrade-model` twice. It will jump to the latest 2.8, then this patch. - Ensure that the logs show no errors relating to unit documents. ## Documentation changes None. ## Bug reference N/A
hmlanigan
approved these changes
Dec 10, 2021
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, thank you.
Test failures:
|
@hmlanigan any insights on these two tests? it looks related to #13556 |
channel request." Found with merge of 2.9 into develop.
commit "Fix tests related to channel/revision changes for client compatibility with 2.9 < controllers"
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Merge from 2.9 bringing forward:
Minor conflicts including those typical to version bumps: