-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
v0.11 breaks Start() -> Reconcile() context propagation #1752
Comments
One way to fix this would be to have manager Options accept a parent context, if you'd be willing to accept a PR for it. |
@nicks Yeah, the reason for this is very clear: we have to control the stop order for different kinds of runnables. When the ctx from |
🤔 ya, that's tricky. i wish context had a way to disconnect the cancellation, but keep all the attached values |
I have a context type that facilitates detaching from the parent for cancellation purposes. Would you like a contribution and potentially leveraging it to pass to the runnables? |
Fixed with #1846 ? As soon as it's released anyway. |
Looks like this was included in https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.12.0 - can this issue be closed? |
yes! 🥳 |
In controller-runtime v0.10, manager.Start(ctx) would propagate that context to all reconcilers. e.g., if you attached a trace context or logger to the context, all reconcilers would be receive that in their context.
https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.0/pkg/manager#Manager
https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.0/pkg/reconcile#Reconciler
In controller-runtime v0.11, the controller manager creates its own "empty" background context
controller-runtime/pkg/manager/runnable_group.go
Line 110 in f236f03
And this is the context passed to the Reconcile(ctx, req) method
Was this an intentional change? are there ways we can add context values in a way that will appear in all reconcilers?
The text was updated successfully, but these errors were encountered: