identity-notifications triggering relies on 'service' key available in the identity-service relation

Bug #1856419 reported by Felipe Reyes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Keystone Charm
Fix Released
Undecided
Felipe Reyes

Bug Description

The identity-notifications interface triggers a *-relation-changed hook to related units every time the keystone catalog is updated, it does a relation-set where the key is {service}-endpoint-changed and the value is a checksum of the urls (public, admin and internal), when the "service" key is not present in the relation, then this logic is skipped as can be seen in https://github.com/openstack/charm-keystone/blob/stable/19.10/hooks/keystone_hooks.py#L442-L444

The problem is that some (old) charms don't set the 'service' key to announce their name, instead the keystone charm will calculate this field based on the prefix of the keys set, see https://github.com/openstack/charm-keystone/blob/stable/19.10/hooks/keystone_utils.py#L1654-L1676

This prevents from emitting notifications for changes made to the catalog by charms like nova-cloud-controller:

  juju run --unit nova-cloud-controller/0 'relation-get -r `relation-ids identity-service` - nova-cloud-controller/0'
egress-subnets: 10.5.0.5/32
ingress-address: 10.5.0.5
nova_admin_url: http://10.5.0.5:8774/v2.1
nova_internal_url: http://10.5.0.5:8774/v2.1
nova_public_url: http://10.5.0.5:8774/v2.1
nova_region: RegionOne
nova_service: nova
placement_admin_url: http://10.5.0.5:8778
placement_internal_url: http://10.5.0.5:8778
placement_public_url: http://10.5.0.5:8778
placement_region: RegionOne
placement_service: placement
private-address: 10.5.0.5

^^^ there is no 'service' key

Here is the output for gnocchi which sets this key:

$ juju run --unit gnocchi/0 'relation-get -r `relation-ids identity-service` - gnocchi/0'
admin_url: https://10.5.0.11:8041
egress-subnets: 10.5.0.11/32
ingress-address: 10.5.0.11
internal_url: https://10.5.0.11:8041
private-address: 10.5.0.11
public_url: https://10.5.0.11:8041
region: RegionOne
service: gnocchi

Tags: sts
Felipe Reyes (freyes)
Changed in charm-keystone:
assignee: nobody → Felipe Reyes (freyes)
Changed in charm-keystone:
status: New → In Progress
Revision history for this message
Felipe Reyes (freyes) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-keystone (master)

Reviewed: https://review.opendev.org/699089
Committed: https://git.openstack.org/cgit/openstack/charm-keystone/commit/?id=0b7ca2624b8171056c92ac19c22ede2ab1e7ecc8
Submitter: Zuul
Branch: master

commit 0b7ca2624b8171056c92ac19c22ede2ab1e7ecc8
Author: Felipe Reyes <email address hidden>
Date: Sat Dec 14 21:49:49 2019 -0300

    Notify changes when service key is missing

    Services that expose multiple endpoints use a prefix in their keys, this
    patch refactors that code to put it in their own function to be reused
    by the notifications functionality and make it notificate for changes in
    those endpoints (e.g. neutron-api and nova-cloud-controller).

    Change-Id: Ieecfc4ef7c85c7f716ceef0c2938ae0c7787953d
    Closes-Bug: #1856419

Changed in charm-keystone:
status: In Progress → Fix Committed
James Page (james-page)
Changed in charm-keystone:
milestone: none → 20.02
Liam Young (gnuoy)
Changed in charm-keystone:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.