-
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
⚠ Support shutdown watches dynamically (v2) #2159
Conversation
Hi @inteon. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
Thanks @inteon , nice work!
It seems you have removed the Stop()
from Controller, so how should users stop one or more specific controller?
/ok-to-test |
@FillZpp what do you think about a more generic solution for canceling runnables: // NewCancelRunnable returns a new Runnable and a function to cancel that runnable.
func NewCancelRunnable(r Runnable) (Runnable, context.CancelFunc) {
mu := sync.Mutex{}
cancel := (func())(nil)
canceled := false
return RunnableFunc(func(ctx context.Context) error {
mu.Lock()
ctx, cancel = context.WithCancel(ctx)
if canceled {
cancel()
}
mu.Unlock()
return r.Start(ctx)
}), func() {
mu.Lock()
defer mu.Unlock()
canceled = true
if cancel != nil {
cancel()
}
}
} |
Emm, I think it's alright. It may not be intuitive as the Stop method, but more generic as you said. |
/label tide/merge-method-squash |
fixes #1884 |
da38baf
to
57edf50
Compare
f57dd5d
to
a169245
Compare
eb6f3e2
to
6c16925
Compare
@alvaroaleman I just added a |
/test pull-controller-runtime-test |
Signed-off-by: Tim Ramlot <[email protected]>
093d2ce
to
cc38429
Compare
Signed-off-by: Tim Ramlot <[email protected]>
Signed-off-by: Tim Ramlot <[email protected]>
Co-authored-by: FillZpp <[email protected]> Signed-off-by: Tim Ramlot <[email protected]>
cc38429
to
b50828a
Compare
/retest |
@inteon: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
I'm discontinuing this effort. Feel free to pick this up and continue this work in a new PR. |
PTAL at the original PR: #2099
I started making some small changes to the original PR, thinking there would be an easy fix. However, it turned out that there were still a lot of fundamental questions requiring more time and effort to get fixed.
The current state of the PR is best described by #2159 (comment).
(4/4) PR chain: