Commit Graph

12 Commits

Author SHA1 Message Date
Patrick Ohly
57bc261e52 client-go watch: NewIndexerInformerWatcherWithContext -> WithLogger
The ability to automatically stop on context cancellation was new functionality
that adds complexity and wasn't really used in Kubernetes. If someone wants
this, they can add it outside of the function.

A *WithLogger variant avoids the complexity and is consistent with
NewStreamWatcherWithLogger over in apimachinery.

Kubernetes-commit: 1a8d8c9b4a33daf9330434e1ad544ef3571722a3
2025-01-31 10:18:04 +01:00
Patrick Ohly
bad1caabde client-go + apimachinery watch: context support
The Lister and Watcher interfaces only supported methods without context, but
were typically implemented with client-go API calls which need a context. New
interfaces get added using the same approach as in
https://github.com/kubernetes/kubernetes/pull/129109.

Kubernetes-commit: 6688adae142e37114d9dfa8d94cd1d8a91fbcc13
2024-12-20 13:55:47 +01:00
Karl Isenberg
7c5e9038dd Update TestNewInformerWatcher for WatchListClient
- Switch to using the ProxyWatcher to validate the dance between
  closing the stop channel and closing the result channel.
- Use the new clientfeaturestesting.SetFeatureDuringTest to test with
  the WatchListClient enabled and disabled. These should result in
  almost the exact same output events from the informer
  (list ordering not garenteed), but with different input events
  recieved from the apiserver.

Kubernetes-commit: 28e3a728e5e6fe651d7a17839d33ce42204c0b4e
2024-06-03 17:31:59 -07:00
Msk233
5d5619d392 stop watcher when error occurs
Kubernetes-commit: da3e7e3781650024e4cc7cb65082908c531e8efa
2023-04-26 09:04:33 +08:00
Hao Ruan
ef522cc423 replace spew methods with dump methods
Kubernetes-commit: c4e1b01416ec05e6a520a181d4ce3b4333adb4e4
2023-04-13 09:41:07 +08:00
Tim Hockin
12553015e2 Replace uses of ObjectReflectDiff with cmp.Diff
ObjectReflectDiff is already a shim over cmp.Diff, so no actual output
or behavior changes

Kubernetes-commit: bc302fa4144d21a338683cd83701661f97be4aba
2023-03-23 11:34:03 -07:00
Chotiwat Chawannakul
a35bc8fe7a Fix stale object causing a panic on DELETE event
Kubernetes-commit: 1f4f78ac414b7a1666e908670c5e447015bdc6b9
2021-01-06 10:38:31 -08:00
Mike Danese
60a0346672 generated: run refactor
Kubernetes-commit: 3aa59f7f3077642592dc8a864fcef8ba98699894
2020-02-07 18:16:47 -08:00
Mike Danese
ba0da5aa4d NewIndexerInformerWatcher: fix goroutine leak
There was some weird queuing going on. The queue was implement by
spawning goroutines that would block on the "ticketer" until it was
their turn to write to the output channel. If N events where in the
watch when the consumer of the watch stopped reading events, N
goroutines would leak. In unit tests of the certificate manager, this
was causing ~10k goroutines to leak.

Fix it with a buffering event processor that uses only one routine and
cancels correctly.

Kubernetes-commit: cafc640bfa0f7362b178b1b896085962d018afe3
2019-05-03 23:50:53 -04:00
Jordan Liggitt
e6881e4a02 Update client callers to use explicit versions
Kubernetes-commit: d1e865ee341ba37469efed8c935e22e2b483eec2
2019-02-22 10:27:46 -05:00
Tomas Nozicka
36160aac1b Make UntilWithSync wait for integrated informers to stop
Kubernetes-commit: b762d2c0d7977a93ee9aab4cefb9363bc0c79ea5
2019-01-21 18:30:00 +01:00
Tomas Nozicka
4528feba43 Add UntilWithSync (informer based)
Kubernetes-commit: 866cc1acab6c1c30a7550b2de7160c8052be884d
2018-08-03 16:45:41 +02:00