Skip to content

Commit 16ffec4

Browse files
committed
Add support for allowWatchBookmarks to the dynamic client
1 parent e104702 commit 16ffec4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

kubernetes/base/dynamic/client.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def server_side_apply(self, resource, body=None, name=None, namespace=None, forc
163163

164164
return self.request('patch', path, body=body, force_conflicts=force_conflicts, **kwargs)
165165

166-
def watch(self, resource, namespace=None, name=None, label_selector=None, field_selector=None, resource_version=None, timeout=None, watcher=None):
166+
def watch(self, resource, namespace=None, name=None, label_selector=None, field_selector=None, resource_version=None, timeout=None, watcher=None, allow_watch_bookmarks=None):
167167
"""
168168
Stream events for a resource from the Kubernetes API
169169
@@ -176,6 +176,7 @@ def watch(self, resource, namespace=None, name=None, label_selector=None, field_
176176
a resource_version greater than this value will be returned
177177
:param timeout: The amount of time in seconds to wait before terminating the stream
178178
:param watcher: The Watcher object that will be used to stream the resource
179+
:param allow_watch_bookmarks: Ask the API server to send BOOKMARK events
179180
180181
:return: Event object with these keys:
181182
'type': The type of event such as "ADDED", "DELETED", etc.
@@ -206,7 +207,8 @@ def watch(self, resource, namespace=None, name=None, label_selector=None, field_
206207
label_selector=label_selector,
207208
resource_version=resource_version,
208209
serialize=False,
209-
timeout_seconds=timeout
210+
timeout_seconds=timeout,
211+
allow_watch_bookmarks=allow_watch_bookmarks,
210212
):
211213
event['object'] = ResourceInstance(resource, event['object'])
212214
yield event
@@ -248,6 +250,8 @@ def request(self, method, path, body=None, **params):
248250
query_params.append(('fieldManager', params['field_manager']))
249251
if params.get('force_conflicts') is not None:
250252
query_params.append(('force', params['force_conflicts']))
253+
if params.get('allow_watch_bookmarks') is not None:
254+
query_params.append(('allowWatchBookmarks', params['allow_watch_bookmarks']))
251255

252256
header_params = params.get('header_params', {})
253257
form_params = []

0 commit comments

Comments
 (0)