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
Crossplane uses a controller engine to dynamically start claim and XR
controllers when a new XRD is installed.
Before this commit, each controller gets at least one cache. This is
because when I built this functionality, you couldn't stop a single
informer within a cache (a cache is basically a map of informers by
GVK).
When realtime composition is enabled, there are even more caches. One
per composed resource GVK. A GVK routed cache routes cache lookups to
these various delegate caches.
Meanwhile, controller-runtime recently made it possible to stop an
informer within a cache. It's also been possible to remove an event
handler from an informer for some time (since Kubernetes 1.26).
kubernetes-sigs/controller-runtime#2285kubernetes-sigs/controller-runtime#2046
This commit uses a single client, backed by a single cache, across all
dynamic controllers (specifically the definition, offered, claim, and
XR controllers).
Compared to the current implementation, this commit:
* Takes fewer global locks when realtime compositions are enabled.
Locking is now mostly at the controller scope.
* Works with the breaking changes to source.Source introduced in
controller-runtime v0.18. :)
I think this makes the realtime composition code a little easier to
follow by consolodating it into the ControllerEngine, but that's
pretty subjective.
Signed-off-by: Nic Cope <[email protected]>
0 commit comments