Skip to content

feat: add role-assignment requirer integration#72

Draft
gboutry wants to merge 4 commits intocanonical:mainfrom
gboutry:feat/role-assignment
Draft

feat: add role-assignment requirer integration#72
gboutry wants to merge 4 commits intocanonical:mainfrom
gboutry:feat/role-assignment

Conversation

@gboutry
Copy link
Copy Markdown
Contributor

@gboutry gboutry commented Mar 27, 2026

Add RoleHandler that integrates with the role-distributor charm via the role-assignment relation. Roles use MicroOVN taxonomy: central (OVN central services), chassis (data plane), and gateway.

Key design decisions:

  • Role assignment is a durable source of truth, re-evaluated on update-status, ovsdb-cms ready/broken, and cluster-changed events.
  • Applied roles are cached in StoredState for idempotency; the cache is invalidated when _dataplane_mode() mutates central outside RoleHandler.
  • Gateway config reads fail closed: transient ovs-vsctl failures block rather than clobbing existing ovn-cms-options from an assumed-empty value.
  • Relation broken keeps workload state unchanged but clears the cache and recomputes unit status.
  • The relation is optional; backward compatibility is preserved when no role-assignment relation exists.

Requires:

gboutry added 4 commits March 27, 2026 00:44
This prevents maturin from trying to download cargo (which fails in
the charmcraft build container on building puccinialin) and instead uses
a well defined rust toolchain version.

Follows examples from the data platform team[0].

0: https://github.com/canonical/opensearch-operator/blob/2ce3ea4186d193b7bef0ba5baa06d900168b8d67/charmcraft.yaml#L77

Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
Ensure setuptools-scm cyclic dependencies affected versions are excluded
from the build dependencies.

Related-Bug: pypa/setuptools-scm#1302
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
This allows the integration tests to invoke snaps (such as juju). In
more recent versions of TOX, all environment variables are cut off from
the subprocess invokation.

Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
Add RoleHandler that integrates with the role-distributor charm via
the role-assignment relation. Roles use MicroOVN taxonomy: central
(OVN central services), chassis (data plane), and gateway.

Key design decisions:
- Role assignment is a durable source of truth, re-evaluated on
  update-status, ovsdb-cms ready/broken, and cluster-changed events.
- Applied roles are cached in StoredState for idempotency; the cache
  is invalidated when _dataplane_mode() mutates central outside
  RoleHandler.
- Gateway config reads fail closed: transient ovs-vsctl failures
  block rather than clobbing existing ovn-cms-options from an
  assumed-empty value.
- Relation broken keeps workload state unchanged but clears the
  cache and recomputes unit status.
- The relation is optional; backward compatibility is preserved when
  no role-assignment relation exists.

Assisted-By: Claude Code (claude-opus-4-6)
Assisted-By: Codex (gpt-5.4-xhigh)
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
@gboutry gboutry force-pushed the feat/role-assignment branch from e91f3f2 to cf6b237 Compare March 27, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant