You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
su, err:=tf.Add(r.mgr, crd, r.provider, r.smLoader, r.defaulters, r.jitterGenerator, nil)
252
-
iferr!=nil {
253
-
returnnil, fmt.Errorf("error adding terraform controller for %v to a manager: %w", crd.Spec.Names.Kind, err)
258
+
259
+
if!hasTerraformController&&!hasDCLController {
260
+
// We're always going to use the direct reconciler
261
+
useDirectReconcilerPredicate=nil
262
+
useLegacyPredicate=nil
263
+
}
264
+
265
+
if (hasTerraformController||hasDCLController) &&useDirectReconcilerPredicate==nil {
266
+
logger.Error(fmt.Errorf("no predicate where we have multiple controllers"), "skipping direct controller registration", "group", gvk.Group, "version", gvk.Version, "kind", gvk.Kind)
267
+
hasDirectController=false
254
268
}
255
-
returnsu, nil
256
269
}
270
+
257
271
// register controllers for direct CRDs
258
-
ifregistry.IsDirectByGK(gvk.GroupKind()) {
272
+
ifhasDirectController {
259
273
model, err:=registry.GetModel(gvk.GroupKind())
260
274
iferr!=nil {
261
275
returnnil, err
262
276
}
263
277
deps:= directbase.Deps{
264
-
JitterGenerator: r.jitterGenerator,
265
-
}
266
-
rg:=registry.GetReconcileGate(gvk.GroupKind())
267
-
ifrg!=nil {
268
-
// If reconcile gate is enabled for this gvk, generate a controller-runtime predicate that will
269
-
// run the direct reconciler only when the reconcile gate returns true.
0 commit comments