Skip to content
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-169] fix bundle deployment with 2.9 client and older controllers #13556

Merged
merged 7 commits into from
Dec 10, 2021

Conversation

hmlanigan
Copy link
Member

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.

$ 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

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.
Allow the order of arguments to change from the expected alphabeticial
ordering.  Update the response appropriately too.
@hmlanigan hmlanigan added the 2.9 label Dec 8, 2021
@hpidcock
Copy link
Member

$$merge$$

@jujubot jujubot merged commit 07164c4 into juju:2.9 Dec 10, 2021
@hmlanigan hmlanigan deleted the deploy-bundle-2-8-controller branch December 10, 2021 14:31
jujubot added a commit that referenced this pull request Dec 15, 2021
#13565

Merge from 2.9 bringing forward:
- #13546 from manadart/2.9-unit-charm-url
- #13564 from jujubot/increment-to-2.9.23
- #13556 from hmlanigan/deploy-bundle-2-8-controller

Minor conflicts including those typical to version bumps:
- apiserver/facades/agent/uniter/mocks/newlxdprofile.go
- cmd/juju/application/deployer/bundlehandler_test.go
- scripts/win-installer/setup.iss
- snap/snapcraft.yaml
- version/version.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants