[DPE-11198] feat(watcher): own the relation events and wire the handler (2/3) - #275
Draft
marceloneppel wants to merge 1 commit into
Draft
[DPE-11198] feat(watcher): own the relation events and wire the handler (2/3)#275marceloneppel wants to merge 1 commit into
marceloneppel wants to merge 1 commit into
Conversation
marceloneppel
changed the base branch from
16/edge
to
watcher-1-port-handler
September 4, 2026 21:54
…er (2/3) Completes the port with the three relation handlers — joined (per-unit address share, leader-only watcher user + Raft secret creation with the defer-on-failure guard, cluster-information handout), changed (cleanup + config update on watcher address change) and broken (cleanup + config update) — and the matching framework observers. The abstract charm constructs the handler before the config manager on VM (inert on K8s, which has no watcher relation) and constructor-injects it, mirroring the LDAP handler wiring. ConfigManager.update_config no longer threads watcher_raft_address from the charm: the VM-only render branch sources the Raft address from the injected handler (address when active, None otherwise), matching the charm's watcher_offer.is_active gate. The parameter is dropped from both update_config and render_patroni_yml_file. watcher_handler is an optional keyword (default None): the production charms construct ConfigManager directly and do not import the abstract charm, so the K8s charm keeps working unchanged at the pin bump. Guards the rewiring: a regression test validating update_config's forwarded render kwargs against the real render signature (a plain Mock swallowed the dropped kwarg), and a k8s render pass with watcher_handler=None proving the VM-only branch never reads it.
marceloneppel
force-pushed
the
watcher-2-wire-handler
branch
from
September 4, 2026 22:00
1451fb6 to
916bc8c
Compare
marceloneppel
force-pushed
the
watcher-1-port-handler
branch
from
September 4, 2026 22:00
237fa74 to
b4fc39b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Stacks on #274.
Solution
WatcherEventsHandlerbefore the config manager on VM (inert on K8s: no construction, no watcher-offer relation in the K8s charm's metadata) and constructor-injects it, mirroring the LDAP handler wiring.ConfigManager.update_configno longer threadswatcher_raft_addressfrom the charm:render_patroni_yml_filesources the Raft address from the injected handler itself inside the VM-only render branch (watcher_raft_address if is_active else None, matching the charm'swatcher_offer.is_activegate). Thewatcher_raft_addressparameter is dropped from bothupdate_configandrender_patroni_yml_file; the remaining ldap/async parameters stay for their own migration phases.watcher_handleris an optional keyword (defaultNone): the production charms constructConfigManagerdirectly and do not import the abstract charm, so the K8s charm keeps working unchanged at the pin bump.