-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[controller] State-of-the-world reconciliation #17
Conversation
f5765a0
to
d1d0329
Compare
Code will still build and run without it, but this will fix resolving the dependencies by the IDE, Visual Studio Code in particular. Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
Adds support for state-of-the world reconciliation. - Resource events grouped by GroupKind instead of GroupVersionResource - changes kind filters (e.g. subscribers) to singular form (e.g. `.Kind == "Gateway") instead of plural ("e.g. `.Resource == "gateways"`) - List of multiple events now supplied to the reconcile funcs instead of single event – this is due to snapshots of the cache updates now accumulating multiple multiple changes - Added Zap logger - New command-line flag `--reconciliation-mode state|delta` to switch between state-of-the-world vs incremental (delta) reconciliation mode – default: state Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
…ad of kind Signed-off-by: Guilherme Cassolato <[email protected]>
3ff132a
to
1124991
Compare
I was looking over this and there was something that came to mind which I am not sure how we would stand on the issue. Being able to run the controller with or with out the need for the controller runtime is nice and I like the concept. But if I choice not use the controller runtime, it and all it's dependence's are included. It seems wrong to force this dependency, but for now I am not sure how we would approach the issue. Or even if it is an issue. |
Signed-off-by: Guilherme Cassolato <[email protected]>
…iler Signed-off-by: Guilherme Cassolato <[email protected]>
d15b559
to
9db9b38
Compare
…s to restructure a listed object Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
Maybe I'm not seeing it all, but it doesn't seem an issue to me, I guess. As long as the controller-runtime layer is not loaded, it's "only" unreachable code, no? |
Signed-off-by: Guilherme Cassolato <[email protected]>
…ng further below is cohesive Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
Signed-off-by: Guilherme Cassolato <[email protected]>
- RuntimeObject -> Object - Object -> RuntimeObject - RuntimeLinkFunc -> LinkFunc + object and event-related types moved to separate files + types.go -> resources.go Signed-off-by: Guilherme Cassolato <[email protected]>
8069a26
to
b5f0de1
Compare
Signed-off-by: Guilherme Cassolato <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified envoy-gateway.md
and multiple-gateway-providers.md
for both delta
and state
reconciliation mode, and both are working as expected 💯
Changes looks good to me! 🥇
Add support for state-of-the-world reconciliation, based on controller-runtime.
Closes #15.
Runnable
interface:{ Run(stopCh <-chan struct{}) }
informers
of the controller to be a list of genericrunnables
WithInformer
toWithRunnable
InformerBuilder(builder)
cache.SharedInformer
that adds incremental changes directly to the cache(default informer builder)ListFunc
to a slice of state reconcilerListFuncs
of the controller (default informer builder)controller.For
tocontroller.Watch
ManagedBy(manager)
Reconciler
interfaceListFuncs
registered with the controllercontroller.Start()
:CallbackFunc
asReconcileFunc
ReconcileFunc
to receive a list ofResourceEvents
WithCallback
toWithReconciler(ReconcileFunc)
Out of scope of the PR but still addressed here (maybe extract to a separate PR)
TODOs
CreateEventUpdateEvent in the state-of-the-world reconcilergithub.com/google/go-cmp/cmp.Equal
: