[JUJU-169] fix bundle deployment with 2.9 client and older controllers #13556
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.
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.
Bug reference
https://bugs.launchpad.net/juju/+bug/1950237
https://bugs.launchpad.net/juju/+bug/1931739