-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request juju#16692 from hmlanigan/remove-api-server-restri…
…ctions juju#16692 This change enables support of the terraform provider for juju with a juju 2.9.latest controller once it moves to the juju 3.3 branch. This is part of a move to ensure that juju clients support their current major version and the last patch of the last minor of the prior major version. This change also makes the upgrade process from 2.9 to 3.x easier as only 1 client will now be necessary. Functionality supported by a juju client is determined by which facade versions both the client and server support. Older clients may not support the latest features in each major release. There is no expectation that a juju 3.x client can bootstrap a juju 2.9 controller etc. Once the client stopped rejecting clients of the next major version, client negotiation is done via facade version. But there's a problem as the params structures used as arguments in a specific set of facade methods are different between 2.9 and 3.x without a facade version nor structure name change. The series, os and channel elements of origin structures were removed. This impacts: deploy, refresh and add-machine. There were 2 choices of how to approach ensuring a 2.9 controller could properly deploy, refresh and add a machine. 1. "Fix" the args to each facade call before they were used to add the series data based on the base supplied in the same structure. 2. Update the workflows for deploy, refresh and adding a machine to prefer a base if provided. Given that a 2.9 controller also requires compatibility with a 2.8 client and many changes were made related to series/base in 3.x, I choose option 1 as being less intrusive. Also less potentially for handling series/base differently from the 3.x code. ## Checklist - [x] Code style: imports ordered, good names, simple structure, etc - [x] Comments saying why design decisions were made - [x] Go unit tests, with comments saying what you're testing - [ ] ~[Integration tests](https://github.com/juju/juju/tree/main/tests), with comments saying what you're testing~ - [ ] ~[doc.go](https://discourse.charmhub.io/t/readme-in-packages/451) added or updated in changed packages~ ## QA steps Note for QA steps: - `juju` refers to the compiled code under test; `juju_33` is the juju snap with channel 3.3/stable. ```bash # # Bootstrap a juju 3.3 controller for later upgrade and migration of a 2.9 model. # $ juju_33 bootstrap localhost destination # # Bootstrap a controller to test the changes # $ juju bootstrap localhost testing # # Run various commands requiring series and base, including charms with and without # $ juju_33 add-mode moveme $ juju_33 deploy juju-qa-test --revision 23 --channel edge $ juju_33 deploy ./tests/suites/deploy/charms/lxd-profile-alt $ juju_33 deploy postgresql $ juju_33 add-machine --base [email protected] $ juju_33 refresh lxd-profile-alt --path ./tests/suites/deploy/charms/lxd-profile-alt # Verify the juju-qa-test resource was correctly downloaded, check the application status for an output change. $ juju_33 config juju-qa-test foo-file=true # Update the base of an application for the next unit added. $ juju_33 set-application-base juju-qa-test [email protected] # Migrate to the 3.3. controller & upgrade. $ juju_33 migrate moveme destination $ juju_33 switch destination $ juju_33 upgrade-model # Ensure base change successful, validate the new unit is using [email protected] $ juju_33 add-unit juju-qa-test # Validate migrations back still fail: $ juju_33 migrate five terraform ERROR target prechecks failed: model has higher version than target controller (3.3.0 > 2.9.48.6) $ juju migrate five terraform ERROR target prechecks failed: model has higher version than target controller (3.3.0 > 2.9.48.6) ``` ## Links JUJU-4922
- Loading branch information
Showing
18 changed files
with
315 additions
and
519 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.