Skip to content

feat: add role-assignment requirer integration#72

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

feat: add role-assignment requirer integration#72
gboutry wants to merge 2 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 gboutry force-pushed the feat/role-assignment branch from e91f3f2 to cf6b237 Compare March 27, 2026 12:27
Copy link
Copy Markdown
Collaborator

@crypticC0der crypticC0der left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also rebase this onto main (8cc5aa8)

@gboutry
Copy link
Copy Markdown
Contributor Author

gboutry commented Mar 30, 2026

can you also rebase this onto main (8cc5aa8)

Thanks for the reply, I'll rebase on main when (#70) is through (or equivalent)

@gboutry gboutry force-pushed the feat/role-assignment branch 2 times, most recently from 5158433 to a790767 Compare March 30, 2026 18:18
@crypticC0der
Copy link
Copy Markdown
Collaborator

Thanks for the reply, I'll rebase on main when (#70) is through (or equivalent)

that is now all sorted 👍 (9614969)

gboutry added 2 commits April 3, 2026 19:01
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 a790767 to 6228bd9 Compare April 3, 2026 17:01
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.

2 participants