You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Watching configures the socket to never time out (however, sooner or later all watches terminate).
224
+
Watching configures the socket to never time out by default (however, sooner or later all watches terminate).
225
225
226
226
One-off actions like `.get_*`, `.delete_*` have a configurable timeout:
227
227
```ruby
@@ -625,6 +625,13 @@ client.watch_pods allow_watch_bookmarks: true do |notice|
625
625
end
626
626
```
627
627
628
+
To limit the maximum duration of a watch on the server, pass the `timeout_seconds:` param.
629
+
```ruby
630
+
client.watch_pods(timeout_seconds:120, namespace: ns) do |notice|
631
+
...
632
+
end
633
+
```
634
+
628
635
#### All watches come to an end!
629
636
630
637
While nominally the watch block *looks* like an infinite loop, that's unrealistic. Network connections eventually get severed, and kubernetes apiserver is known to terminate watches.
0 commit comments