mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-31 06:41:52 +00:00
reflector: exit retry loop on closed stopCh
Kubernetes-commit: 8d98c846272b3fb4988bebf54b197d24d8fb3b5f
This commit is contained in:
parent
b9cceae1f8
commit
097057c51c
7
tools/cache/reflector.go
vendored
7
tools/cache/reflector.go
vendored
@ -295,6 +295,13 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
|
||||
}()
|
||||
|
||||
for {
|
||||
// give the stopCh a chance to stop the loop, even in case of continue statements further down on errors
|
||||
select {
|
||||
case <-stopCh:
|
||||
return nil
|
||||
default:
|
||||
}
|
||||
|
||||
timemoutseconds := int64(minWatchTimeout.Seconds() * (rand.Float64() + 1.0))
|
||||
options = metav1.ListOptions{
|
||||
ResourceVersion: resourceVersion,
|
||||
|
Loading…
Reference in New Issue
Block a user