Commit cfc12d9
authored
Merge pull request #825 from cderici/communicate-series-to-resolve-charm-for-29
#825
#### Description
Without the series the ResolveCharm will select the latest base for the charm. E.g. even if we want `focal`, the `ResolveCharms` will return `22.04` (jammy) for the base channel in the resulting origin if the charm supports both jammy and focal.
This communicates the series info with the `ResolveCharms` via the inputted origin so the resulting origin will have the correct base channel.
Fixes #822
#### QA Steps
This is against 2.9, so get a juju 2.9 and bootstrap a `2.9` controller.
```sh
$ sudo snap install juju --channel=2.9/stable --classic
$ juju bootstrap localhost test
```
Then copy paste the following code from #822 deploy command into the `examples/deploy.py`
```python
LCM_CHARM = "osm-lcm"
LCM_APP = "lcm"
LCM_CHANNEL = "latest/beta"
LCM_SERIES = "focal"
LCM_RESOURCES = {"lcm-image": "opensourcemano/lcm:testing-daily"}
async def deploy():
model = Model()
await model.connect_current()
try:
await model.deploy(
LCM_CHARM,
application_name=LCM_APP,
resources=LCM_RESOURCES,
channel=LCM_CHANNEL,
series=LCM_SERIES,
)
finally:
await model.disconnect()
```
Then just run it from the top:
```sh
$ python examples/deploy.py
```
After starting this (doesn't need to return), just check the `juju status` and you should see the revision 174 according to the `juju info osm-lcm`.
I suggest trying it with different channels and revisions, as well as different charms too. I did try with different channels and it seems to be working well. I haven't tried it with different charms.
Also we need to be careful about the CI tests, as this might change things, so we need to make sure all the charm related teests are passing.
#### Notes & Discussion
I haven't tried this in > 3.0, we might need to cherry pick this into the master as well.1 file changed
Lines changed: 18 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
| 555 | + | |
| 556 | + | |
556 | 557 | | |
557 | | - | |
558 | | - | |
| 558 | + | |
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | 563 | | |
573 | 564 | | |
574 | 565 | | |
| |||
1722 | 1713 | | |
1723 | 1714 | | |
1724 | 1715 | | |
1725 | | - | |
| 1716 | + | |
1726 | 1717 | | |
1727 | 1718 | | |
1728 | 1719 | | |
| |||
1733 | 1724 | | |
1734 | 1725 | | |
1735 | 1726 | | |
| 1727 | + | |
1736 | 1728 | | |
1737 | 1729 | | |
1738 | 1730 | | |
| 1731 | + | |
1739 | 1732 | | |
1740 | 1733 | | |
1741 | 1734 | | |
| |||
1749 | 1742 | | |
1750 | 1743 | | |
1751 | 1744 | | |
1752 | | - | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
1753 | 1757 | | |
1754 | 1758 | | |
1755 | 1759 | | |
| |||
0 commit comments