Skip to content

Commit 2d6966f

Browse files
committed
Fix Watch follow parameter detection
The generated client now emits parameter names and types on separate lines. Watch still searches for the old combined line, so it sends watch=True to pod log methods and the generated client rejects the unexpected keyword. Match the current generated format and update the fixture that covers log streaming.
1 parent f8c3ba2 commit 2d6966f

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

kubernetes/base/watch/watch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from kubernetes import client
2020

2121
PYDOC_RETURN_LABEL = ":rtype:"
22-
PYDOC_FOLLOW_PARAM = ":param bool follow:"
22+
PYDOC_FOLLOW_PARAM = ":param follow:"
2323

2424
# Removing this suffix from return type name should give us event's object
2525
# type. e.g., if list_namespaces() returns "NamespaceList" type,

kubernetes/base/watch/watch_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ def test_watch_for_follow(self):
204204

205205
fake_api = Mock()
206206
fake_api.read_namespaced_pod_log = Mock(return_value=fake_resp)
207-
fake_api.read_namespaced_pod_log.__doc__ = ':param bool follow:\n:rtype: str'
207+
fake_api.read_namespaced_pod_log.__doc__ = (
208+
':param follow:\n:type follow: bool\n:rtype: str')
208209

209210
w = Watch()
210211
count = 1

0 commit comments

Comments
 (0)