@@ -106,7 +106,9 @@ The `ctrl.Manager` _SHOULD_ be extended to get an optional `cluster.Provider` vi
106106// pkg/cluster
107107
108108// Provider defines methods to retrieve clusters by name. The provider is
109- // responsible for discovering and managing the lifecycle of each cluster.
109+ // responsible for discovering and managing the lifecycle of each cluster,
110+ // and to engage or disengage clusters with the manager the provider is
111+ // run against.
110112//
111113// Example: A Cluster API provider would be responsible for discovering and
112114// managing clusters that are backed by Cluster API resources, which can live
@@ -196,6 +198,8 @@ clusters with non-empty name "provider clusters" or "enganged clusters", while
196198the embedded cluster of the manager is called the "default cluster" or "hub
197199cluster".
198200
201+ ### Cluster-Aware Request
202+
199203To provide information about the source cluster of a request, a new type
200204` reconcile.ClusterAwareRequest ` _ SHOULD_ be added:
201205
@@ -214,11 +218,21 @@ Given that an empty cluster name represents the "default cluster", a `reconcile.
214218can be used as ` request ` type even for controllers that do not have an active cluster provider.
215219The cluster name will simply be an empty string, which is compatible with calls to ` mgr.GetCluster ` .
216220
221+ ** Note:** controller-runtime must provide this cluster-aware request type to
222+ allow writing * uniform* multi-cluster controllers (see goals), i.e. controllers
223+ that both work as single-cluster and multi-cluster controllers against arbitrary
224+ cluster providers. Think of generic CNCF projects like cert-manager wanting to
225+ support multi-cluster setups generically without forking the codebase.
226+
217227### BYO Request Type
218228
219229Instead of using the new ` reconcile.ClusterAwareRequest ` , implementations _ CAN_ also bring their
220230own request type through the generics support in ` Typed* ` types (` request comparable ` ).
221231
232+ ** Note:** these kind of controllers won't be uniform in the sense of compatibility
233+ with arbitrary cluster providers, but for use-cases that are tiedly integrated
234+ with specific cluster providers, this might be useful.
235+
222236Optionally, a passed ` TypedEventHandler ` will be duplicated per engaged cluster if they
223237fullfil the following interface:
224238
0 commit comments