]> git.feebdaed.xyz Git - 0xmirror/cilium.git/commit
clustermesh: introduce Observer interface to favor extensibility
authorMarco Iorio <marco.iorio@isovalent.com>
Wed, 17 Dec 2025 08:16:51 +0000 (09:16 +0100)
committerMarco Iorio <marco.iorio@isovalent.com>
Sat, 20 Dec 2025 07:44:40 +0000 (07:44 +0000)
commit0a879d0c23ce6f29becc841071ba24d0c8d800c7
treec14d2f93b7eb002b57da5fc7b0d4c6d934139300
parentcafdb02bf0ba180a979ec1e7d99910adab7cab4a
clustermesh: introduce Observer interface to favor extensibility

Currently, the list of prefixes watched for each remote cluster, and the
logic to handle the corresponding watch events is strongly coupled with
the clustermesh implementation itself. However, this has the downside of
increasing the overall complexity, and making it difficult to add the
support for new prefixes, both in-tree and by downstream projects.

As an initial effort towards decoupling, let's introduce the [Observer]
interface. Once hooked into place via the subsequent commits, new
observers could be simply introduced implementing this interface,
and providing it via hive, without having to modify and extend the
underlying clustermesh logic.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
pkg/clustermesh/observer/observer.go [new file with mode: 0644]