Skip to content

Commit eb21baa

Browse files
authored
Merge pull request #942 from cderici/pass-correct-url-to-series-selector
#942 #### Description Currently (before this change) we seem to be passing to the series selector the default url for the charm (e.g. `ch:zinc-k8s`), instead of the url returned from the `ResolveCharms` facade call (e.g. `ch:amd64/jammy/zinc-k8s-117`). As a result we're sending the wrong url (e.g., in #925 `ch:amd64/focal/zinc-k8s-117`) to the `AddPendingResources`, which results in the wrong image to be selected for the resources for the charm (e.g., the incorrect oci-image for the zinc-k8s charm in #925). Fixes #925 #### QA Steps ```sh $ juju version 3.x (mine is 3.1.6-ubuntu-amd64) $ juju bootstrap microk8s deleteme $ juju add-model issue925 $ juju deploy zinc-k8s --channel edge --trust zinc-with-juju $ microk8s.kubectl -n issue925 get pods zinc-with-juju-0 -o json | jq '.spec.containers[1].image' "registry.jujucharms.com/charm/hgjw3c886prn4ysv07exaoapcjerfrxyxjt7d/zinc-image@sha256:f5a776b8d6c9dbcbae71983438837b3b3f06d65b631e49c6f12350b340b2f563" ``` Now deploy with pylibjuju ```python $ python -m asyncio >>> from juju import model;m=model.Model();await m.connect(); >>> await m.deploy("zinc-k8s", channel="edge", application_name="zinc-with-pylibjuju") <Application entity_id="zinc-with-pylibjuju"> >>> exit() ``` and check to see if the images are the same: ```sh $ microk8s.kubectl -n issue925 get pods zinc-with-pylibjuju-0 -o json | jq '.spec.containers[1].image' "registry.jujucharms.com/charm/hgjw3c886prn4ysv07exaoapcjerfrxyxjt7d/zinc-image@sha256:f5a776b8d6c9dbcbae71983438837b3b3f06d65b631e49c6f12350b340b2f563" ``` #### Notes & Discussion JUJU-4556
2 parents f21bc42 + b0704cf commit eb21baa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

juju/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1897,7 +1897,7 @@ async def _resolve_charm(self, url, origin, force=False, series=None, model_conf
18971897
charm_url = URL.parse(result.url)
18981898

18991899
# run the series selector to get a series for the base
1900-
selected_series = utils.series_selector(series, url, model_config, supported_series, force)
1900+
selected_series = utils.series_selector(series, charm_url, model_config, supported_series, force)
19011901
result.charm_origin.base = utils.get_base_from_origin_or_channel(resolved_origin, selected_series)
19021902
charm_url.series = selected_series
19031903

0 commit comments

Comments
 (0)