Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-libjuju attempts to deploy charms (from bundles) incorrectly #1047

Open
jack-w-shaw opened this issue Apr 30, 2024 · 0 comments
Open
Assignees

Comments

@jack-w-shaw
Copy link
Member

jack-w-shaw commented Apr 30, 2024

Description

For compatibility reasons, when we deploy a charm, the OS is provided in 3 different places in args. These being:

Since juju 2.9.47, the controller began asserting these three places matched. This simple verification turned out to break a load of things, since some clients do not behave. This verification was intended to be a sanity check that was never tripped. Since contradicting params here means a client is contradicting itself

It turns out python-libjuju bundle deploy is behaving badly here. I suspect we do not construct the charm origin properly & do not take into account provided series in a bundle.

Urgency

Annoying bug in our test suite

Python-libjuju version

2.9

Juju version

2.9

Reproduce / Test

This results in:

$ python -m asyncio
>>> from juju.model import Model
>>> m = Model()
>>> await m.connect()
>>> await m.deploy("juju-qa-bundle-test")
...
juju.errors.JujuError: ['cannot deploy application: inconsistent values for series detected. argument: "focal", charm origin series: "jammy", charm origin base: "ubuntu@22.04/stable", charm url: "jammy"']

^ Note the series param is being correctly set to focal, and the charm origin is incorrectly being set to jammy. This charm supports both jammy and focal

However

$ juju deploy juju-qa-bundle-test
Located bundle "juju-qa-bundle-test" in charm-hub, revision 3
Located charm "juju-qa-test" in charm-hub, channel 2.0/stable
Located charm "juju-qa-test" in charm-hub, channel latest/candidate
Located charm "ntp" in charm-hub, channel stable
Located charm "ntp" in charm-hub, channel stable
Executing changes:
- upload charm juju-qa-test from charm-hub for series jammy from channel 2.0/stable with architecture=amd64
- deploy application juju-qa-test from charm-hub on jammy with 2.0/stable
  added resource foo-file
- set annotations for juju-qa-test
- upload charm juju-qa-test from charm-hub for series focal from channel latest/candidate with architecture=amd64
- deploy application juju-qa-test-focal from charm-hub on focal with latest/candidate using juju-qa-test
  added resource foo-file
- set annotations for juju-qa-test-focal
- upload charm ntp from charm-hub for series jammy from channel stable with architecture=amd64
- deploy application ntp from charm-hub on jammy with stable
- set annotations for ntp
- upload charm ntp from charm-hub for series focal from channel stable with architecture=amd64
- deploy application ntp-focal from charm-hub on focal with stable using ntp
- set annotations for ntp-focal
- add new machine 0
- add new machine 1
- add relation ntp:juju-info - juju-qa-test:juju-info
- add relation ntp-focal:juju-info - juju-qa-test-focal:juju-info
- add unit juju-qa-test/0 to new machine 0
- add unit juju-qa-test-focal/0 to new machine 1
Deploy of bundle completed.

(wait)
$ juju status
Model  Controller  Cloud/Region         Version   SLA          Timestamp
m      lxd         localhost/localhost  2.9.50.1  unsupported  11:55:39+01:00

App                 Version  Status  Scale  Charm         Channel           Rev  Exposed  Message
juju-qa-test                 active      1  juju-qa-test  2.0/stable         22  no       hello
juju-qa-test-focal           active      1  juju-qa-test  latest/candidate   20  no       hello
ntp                 4.2      active      1  ntp           stable             50  no       chrony: Ready, time sync disabled in container
ntp-focal           3.5      active      1  ntp           stable             50  no       chrony: Ready, time sync disabled in container

Unit                   Workload  Agent  Machine  Public address  Ports    Message
juju-qa-test-focal/0*  active    idle   1        10.219.211.162           hello
  ntp-focal/0*         active    idle            10.219.211.162  123/udp  chrony: Ready, time sync disabled in container
juju-qa-test/0*        active    idle   0        10.219.211.211           hello
  ntp/0*               active    idle            10.219.211.211  123/udp  chrony: Ready, time sync disabled in container

Machine  State    Address         Inst id        Series  AZ  Message
0        started  10.219.211.211  juju-e2c517-0  jammy       Running
1        started  10.219.211.162  juju-e2c517-1  focal       Running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants