forked from juju/juju
-
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#17456 from jack-w-shaw/hardcode_things
juju#17456 We have decided that relying on distro-info to calculated supported bases was a mistake, instead, we should hard code this information into juju. This means we need to hard code a mapping between bases and series, for the two remaining places in juju we need a series (MAAS & azure). Move this code into `internal/provider/common`. This is ok, since we will will require a code change to support any new controller bases or workload bases anyway. Hard code ControllerBases and WorkloadBases. We decided recently these were to be hard coded, as the team will always need to work to verify Juju supports a new base. It would be a mistake to support a new base before we know what it may break. This means we can completely remove checks to distro info! I clean up `core/base` substantially ## 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 ### Bootstrap bases ``` $ juju bootstrap lxd test --bootstrap-base ubuntu@21.04 Creating Juju controller "test" on lxd/localhost ERROR failed to bootstrap model: use --force to override: ubuntu@21.04/stable not supported $ juju bootstrap lxd lxd --bootstrap-base ubuntu@21.04 --force (attempts to bootstrap. However this will probably fail) ``` ``` $ juju bootstrap lxd test --bootstrap-base ubuntu@20.04 (success) $ juju bootstrap lxd test2 --bootstrap-base ubuntu@22.04 (success) ``` ### Azure ``` $ juju bootstrap azure azure $ juju switch controller $ juju add-machine --base ubuntu@20.04 $ juju add-machine --base ubuntu@22.04 $ juju status Model Controller Cloud/Region Version Timestamp controller azure azure/centralus 4.0-beta4.1 14:54:34+01:00 App Version Status Scale Charm Channel Rev Exposed Message controller active 1 juju-controller 4.0/stable 91 no Unit Workload Agent Machine Public address Ports Message controller/0* active idle 0 172.169.204.21 Machine State Address Inst id Base AZ Message 0 started 172.169.204.21 juju-489299-0 ubuntu@22.04 1 started 172.169.204.230 juju-489299-1 ubuntu@20.04 2 started 172.169.204.255 juju-489299-2 ubuntu@22.04 ``` NOTE: There is currently a known bug meaning we can't add new models to Azure [LP#2068617](https://bugs.launchpad.net/juju/+bug/2068617) ### Workloads Bootstrap ``` juju bootstrap lxd lxd juju add-model m ``` Download and unzip a charm ``` mkdir ubuntu cd ubuntu juju download ubuntu unzip ./ubuntu_r24.charm cd .. ``` And edit it's manifest such that ``` $ cat ubuntu/manifest.yaml bases: - architectures: - amd64 channel: '20.04' name: ubuntu ``` i.e. it only support focal ubuntu@20.04 #### Attempt to deploy in various ways ``` $ juju deploy ./ubuntu --base ubuntu@22.04 ERROR base "ubuntu@22.04/stable" is not supported, supported bases are: ubuntu@20.04 $ juju deploy ./ubuntu --base ubuntu@22.04 --force Located local charm "ubuntu", revision 0 Deploying "ubuntu" from local charm "ubuntu", revision 0 on ubuntu@22.04/stable $ juju deploy ./ubuntu --base ubuntu@22.04 ERROR base "ubuntu@22.04/stable" is not supported, supported bases are: ubuntu@20.04 $ juju deploy ./ubuntu --base ubuntu@18.04 ERROR ubuntu is not available on the following base: ubuntu@18.04/stable not supported $ juju deploy ./ubuntu --base ubuntu@21.04 ERROR ubuntu is not available on the following base: ubuntu@21.04/stable not supported $ juju deploy ./ubuntu --base ubuntu@20.04 Located local charm "ubuntu", revision 2 Deploying "ubuntu" from local charm "ubuntu", revision 2 on ubuntu@20.04/stable ```
- Loading branch information
Showing
41 changed files
with
150 additions
and
1,456 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
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.