Incorrect series used during upgrade to a local charm and no way to specify it manually
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Eric Claude Jones |
Bug Description
Scenario:
1. I want to use a local version of a charm with an applied patch. A non-patched version is already deployed;
2. The charm supports different series including trusty;
3. The deployed version is of a 'trusty' series;
4. juju upgrade-charm --path <p> fails
ubuntu@maas:~⟫ juju status keystone
Model Controller Cloud/Region Version
default foundations-
App Version Status Scale Charm Store Rev OS Notes
keystone 9.2.0 active 3 keystone jujucharms 0 ubuntu
keystone-hacluster active 3 hacluster jujucharms 33 ubuntu
Unit Workload Agent Machine Public address Ports Message
keystone/0 active idle 3/lxd/6 172.16.10.41 5000/tcp Unit is ready
keystone-
keystone/1* active idle 1/lxd/7 172.16.10.35 5000/tcp Unit is ready
keystone-
keystone/3 active idle 2/lxd/12 172.16.10.5 5000/tcp Unit is ready
keystone-
Machine State DNS Inst id Series AZ
1 started 172.16.10.253 fkrbrg trusty default
1/lxd/7 started 172.16.10.35 juju-43d9c4-1-lxd-7 trusty
2 started 172.16.10.2 fxxtes trusty default
2/lxd/12 started 172.16.10.5 juju-43d9c4-
3 started 172.16.10.3 sph73g trusty default
3/lxd/6 started 172.16.10.41 juju-43d9c4-3-lxd-6 trusty
...
ubuntu@maas:~⟫ juju config keystone | grep -P 'openstack-
openstack-origin:
value: cloud:trusty-mitaka
# upgrade fails
ubuntu@maas:~⟫ juju upgrade-charm keystone --path ~/build/
Added charm "local:
ERROR cannot upgrade application "keystone" to charm "local:
# the charm supports multiple series, trusty included
1 ubuntu@maas:~⟫ grep -P 'xenial|
- xenial
- zesty
- trusty
- yakkety
# shouldn't have to but
ubuntu@maas:~⟫ juju upgrade-charm keystone --path ~/build/
Added charm "local:
ERROR cannot upgrade application "keystone" to charm "local:
If I remove older versions from metadata.yaml it deploys just fine.
ubuntu@maas:~⟫ sed -i -e '/- xenial/d' ~/build/
ubuntu@maas:~⟫ juju upgrade-charm keystone --path ~/build/
Added charm "local:
ERROR cannot upgrade application "keystone" to charm "local:
# note that I haven't deleted yakkety and it is below zesty and xenial. It worked due to the order of processing
ubuntu@maas:~⟫ cat ~/build/
series:
- trusty
- yakkety
extra-bindings:
ubuntu@maas:~⟫ juju upgrade-charm keystone --path ~/build/
Added charm "local:
tags: | added: charm charmers upgrade-charm |
Changed in juju: | |
status: | New → Triaged |
tags: | added: cpe |
Changed in juju: | |
importance: | Undecided → High |
tags: |
added: talisman removed: charm charmers cpe upgrade-charm |
tags: | added: cpe upgrade-charm |
tags: | added: cdo-qa-blocker |
Changed in juju: | |
milestone: | none → 2.2-beta2 |
Changed in juju: | |
assignee: | nobody → Eric Claude Jones (ecjones) |
Changed in juju: | |
status: | Triaged → In Progress |
Changed in juju: | |
milestone: | 2.2-beta2 → 2.2-beta3 |
Changed in juju: | |
status: | In Progress → Fix Committed |
Changed in juju: | |
status: | Fix Committed → Fix Released |
So the issue is that when doing "juju upgrade-charm --path" we are inferring what series we should use as the "default" series from the charm, which is always the first item listed in the series.
So if you move "trusty" to be the first series in the series list, then it should work (you shouldn't have to remove xenial, just switch trusty to be the first item).
We should have 'upgrade-charm' know what series the existing application is, and check if its one of the supported series from the charm, and if so, use it. Rather than only supporting the default series.