policyd-override is not updated after the attach-resource (due to charm not implementing upgrade-charm hook)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Neutron API Charm |
Fix Released
|
High
|
Cornellius Metto |
Bug Description
neutron-api units have already a policyd-override in place and I want to update it with a new one.
I create a zip file containing the new yaml and attach it with:
$ juju attach-resource neutron-api policyd-
But I can't see the new policy in the /etc/neutron/
If i list resources I can see that the units are not fetching the new revision of the resource from the controller and the revision they are using is not equal to the expected one:
$ juju resources neutron-api --details
Unit Resource Revision Expected
neutron-api/0 policyd-override 2021-11-02T11:01 2021-15-02T12:42
neutron-api/1 policyd-override 2021-11-02T11:01 2021-15-02T12:42
neutron-api/2 policyd-override 2021-11-02T11:01 2021-15-02T12:42
In the units logs I can see:
2021-02-15 12:48:21 INFO juju.worker.uniter resolver.go:147 found queued "upgrade-charm" hook
2021-02-15 12:48:22 INFO juju.worker.
Workaround
============
$ juju run -a neutron-api resource-get policyd-override
After that the revision is equal to the expected:
$ juju resources neutron-api --details
Unit Resource Revision Expected
neutron-api/0 policyd-override 2021-15-02T12:42 2021-15-02T12:42
neutron-api/1 policyd-override 2021-15-02T12:42 2021-15-02T12:42
neutron-api/2 policyd-override 2021-15-02T12:42 2021-15-02T12:42
and then I need to disable (false) and re-enable (true) policyd-override with:
$ juju config neutron-api use-policyd-
$ juju config neutron-api use-policyd-
Versions
===========
1. charm-neutron-api rev. 287
2. juju v2.8.7
3. cloud:bionic-ussuri
summary: |
- policyd-override is not updated after the attach-resource + policyd-override is not updated after the attach-resource (due to charm + not implementing upgrade-charm hook) |
Changed in charm-neutron-api: | |
status: | New → Triaged |
importance: | Undecided → High |
milestone: | none → 21.04 |
Changed in charm-neutron-api: | |
assignee: | nobody → Cornellius Metto (ckmetto) |
Changed in charm-neutron-api: | |
status: | Triaged → In Progress |
Changed in charm-neutron-api: | |
milestone: | 21.04 → none |
tags: |
added: good-first-bug removed: onboarding |
Changed in charm-neutron-api: | |
milestone: | none → 21.10 |
Changed in charm-neutron-api: | |
status: | Fix Committed → Fix Released |
The reason the policy-override is not working is due to the charm not having an upgrade-charm hook, which was a bit of a surprise.
Fix: add upgrade-charm hook to minimally process the policyd using `maybe_ do_policyd_ overrides( )` helper function in charm-helpers.