@@ -106,7 +106,9 @@ The `ctrl.Manager` _SHOULD_ be extended to get an optional `cluster.Provider` vi
106
106
// pkg/cluster
107
107
108
108
// 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.
110
112
//
111
113
// Example: A Cluster API provider would be responsible for discovering and
112
114
// 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
196
198
the embedded cluster of the manager is called the "default cluster" or "hub
197
199
cluster".
198
200
201
+ ### Cluster-Aware Request
202
+
199
203
To provide information about the source cluster of a request, a new type
200
204
` reconcile.ClusterAwareRequest ` _ SHOULD_ be added:
201
205
@@ -214,11 +218,21 @@ Given that an empty cluster name represents the "default cluster", a `reconcile.
214
218
can be used as ` request ` type even for controllers that do not have an active cluster provider.
215
219
The cluster name will simply be an empty string, which is compatible with calls to ` mgr.GetCluster ` .
216
220
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
+
217
227
### BYO Request Type
218
228
219
229
Instead of using the new ` reconcile.ClusterAwareRequest ` , implementations _ CAN_ also bring their
220
230
own request type through the generics support in ` Typed* ` types (` request comparable ` ).
221
231
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
+
222
236
Optionally, a passed ` TypedEventHandler ` will be duplicated per engaged cluster if they
223
237
fullfil the following interface:
224
238
0 commit comments