-
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
⚠ Add context to EventHandler(s) #2139
⚠ Add context to EventHandler(s) #2139
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @alvaroaleman @sbueringer |
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.
Nice!
Looking forward to use the ctx in our event handlers :)
Just a few nits
This changeset adds a context.Context parameter to every EventHandler call. Most project might use MapFunc specifically to retrieve other objects with clients and potentially enqueue requests to a watching object. A context is useful in these cases to avoid using context.TODO() or Background() which never gets cancelled. Signed-off-by: Vince Prignano <[email protected]>
606f970
to
2464a9d
Compare
/lgtm /hold |
/hold cancel Let me know if folks have any further feedback, we can continue later |
…alpha.0 - update k8s dependencies to v0.27.1 - update controller-runtime to v0.15.0-alpha.0 - add context to EventHandler calls, see: kubernetes-sigs/controller-runtime#2139 Signed-off-by: Simone Tiraboschi <[email protected]>
…beta.0 - update k8s dependencies to v0.27.2 - update controller-runtime to v0.15.0-beta.0 - add context to EventHandler calls, see: kubernetes-sigs/controller-runtime#2139 Signed-off-by: Simone Tiraboschi <[email protected]>
…beta.0 - update k8s dependencies to v0.27.2 - update controller-runtime to v0.15.0-beta.0 - add context to EventHandler calls, see: kubernetes-sigs/controller-runtime#2139 Signed-off-by: Simone Tiraboschi <[email protected]>
- update k8s dependencies to v0.27.2 - update controller-runtime to v0.15.0 - add context to EventHandler calls, see: kubernetes-sigs/controller-runtime#2139 Signed-off-by: Simone Tiraboschi <[email protected]>
…114) - update k8s dependencies to v0.27.2 - update controller-runtime to v0.15.0 - add context to EventHandler calls, see: kubernetes-sigs/controller-runtime#2139 Signed-off-by: Simone Tiraboschi <[email protected]>
https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.15.0 * Make `*http.Client` configurable and use/share the same client by default kubernetes-sigs/controller-runtime#2122 * Remove dependency injection functions kubernetes-sigs/controller-runtime#2134, kubernetes-sigs/controller-runtime#2120 * Add context to EventHandler(s) kubernetes-sigs/controller-runtime#2139 * `Validator` and `CustomValidator` interfaces have been modified to allow returning warnings kubernetes-sigs/controller-runtime#2014 * operator-framework is also pinned to ecb9be48837 until a new release is cut supporting controller-runtime v0.15.0 Signed-off-by: Lee Yarwood <[email protected]>
…as the first parameter for every method. kubernetes-sigs/controller-runtime#2139
https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.15.0 * Make `*http.Client` configurable and use/share the same client by default kubernetes-sigs/controller-runtime#2122 * Remove dependency injection functions kubernetes-sigs/controller-runtime#2134, kubernetes-sigs/controller-runtime#2120 * Add context to EventHandler(s) kubernetes-sigs/controller-runtime#2139 * `Validator` and `CustomValidator` interfaces have been modified to allow returning warnings kubernetes-sigs/controller-runtime#2014 * operator-framework is also pinned to ecb9be48837 until a new release is cut supporting controller-runtime v0.15.0 Signed-off-by: Lee Yarwood <[email protected]>
https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.15.0 * Make `*http.Client` configurable and use/share the same client by default kubernetes-sigs/controller-runtime#2122 * Remove dependency injection functions kubernetes-sigs/controller-runtime#2134, kubernetes-sigs/controller-runtime#2120 * Add context to EventHandler(s) kubernetes-sigs/controller-runtime#2139 * `Validator` and `CustomValidator` interfaces have been modified to allow returning warnings kubernetes-sigs/controller-runtime#2014 * operator-framework is also pinned to ecb9be48837 until a new release is cut supporting controller-runtime v0.15.0 Signed-off-by: Lee Yarwood <[email protected]>
- Removal of deprecated manager options: - kubernetes-sigs/controller-runtime#2422 - Context added to `EnqueueRequestsFromMapFunc` - kubernetes-sigs/controller-runtime#2139
- Removal of deprecated manager options: - kubernetes-sigs/controller-runtime#2422 - Context added to `EnqueueRequestsFromMapFunc` - kubernetes-sigs/controller-runtime#2139
- Removal of deprecated manager options: - kubernetes-sigs/controller-runtime#2422 - Context added to `EnqueueRequestsFromMapFunc` - kubernetes-sigs/controller-runtime#2139
- Removal of deprecated manager options: - kubernetes-sigs/controller-runtime#2422 - Context added to `EnqueueRequestsFromMapFunc` - kubernetes-sigs/controller-runtime#2139
This changeset adds a context.Context parameter to every EventHandler call. Most project might use MapFunc specifically to retrieve other objects with clients and potentially enqueue requests to a watching object. A context is useful in these cases to avoid using context.TODO() or Background() which never gets cancelled.
Signed-off-by: Vince Prignano [email protected]