Expose leadership over websocket API

Bug #1643691 reported by Anastasia
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Wishlist
Unassigned

Bug Description

From github.com issues, https://github.com/juju/juju/issues/6591:

At present, if a charm depends on the leadership layer, and one wants to know whether a deployed unit is the leader, one can invoke FullStatus via the Client Facade over the websocket api, and then dig through the resulting json object.

This ticket requests that leadership be added to the deltas that get passed over the websocket connection, so that libraries like python-libjuju can keep track of leadership in their model, along with everything else, without requiring a separate FullStatus invocation.

This currently affects the matrix testing suite (https://github.com/juju-solutions/matrix), which cares about leadership, and currently needs to send a flurry of additional queries over the api, and/or cache potentially outdated information, in order to track leadership.

To clarify, the issue is that the unit deltas that come in on the AllWatcher do not contain the leadership flag but otherwise contains all or more of the fields from UnitStatus. This means that leadership is the only field that requires an explicit separate call to one of FullStatus, ApplicationStatus, or UnitStatus.

Tags: libjuju
no longer affects: juju-core
Changed in juju:
status: New → Triaged
importance: Undecided → Wishlist
Cory Johns (johnsca)
tags: added: matrix
Cory Johns (johnsca)
tags: added: libjuju
Revision history for this message
Alvaro Uria (aluria) wrote :

This is the implementation of "is_leader_from_status" in python-libjuju [1], which also references this bug.

1. https://github.com/juju/python-libjuju/pull/13

Caner Derici (cderici)
tags: removed: matrix
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.