<p>Trying to use the python kubernetes API to stream the output of kubernetes pod logs. (eventual goal is to stream the logs out via websocket)</p>

<p>Based off this <a href="https://github.com/kubernetes-client/python-base/pull/93" rel="noreferrer">PR</a> that was merged into python kubernetes module, i thought watch would work with read_namespaced_pod_log?</p>

<pre><code>v1 = client.CoreV1Api()
w = watch.Watch()
for e in w.stream(v1.read_namespaced_pod_log, name=pod, namespace=namespace, follow=True, tail_lines=1, limit_bytes=560, _preload_content=False):
   print(e)
</code></pre>

<p>But i get the error below, am i missing something that needs to be passed to watch? or read_namespaced_pod_log?</p>

<pre><code>Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/usr/local/lib/python3.7/site-packages/kubernetes/watch/watch.py", line 132, in stream
    resp = func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/apis/core_v1_api.py", line 18538, in read_namespaced_pod_log
    (data) = self.read_namespaced_pod_log_with_http_info(name, namespace, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/kubernetes/client/apis/core_v1_api.py", line 18576, in read_namespaced_pod_log_with_http_info
    " to method read_namespaced_pod_log" % key
TypeError: Got an unexpected keyword argument 'watch' to method read_namespaced_pod_log
</code></pre>

<p>You should just do:</p>

<pre><code>v1 = client.CoreV1Api()
w = Watch()
for e in w.stream(v1.read_namespaced_pod_log, name=pod, namespace=namespace):
    print(e)
</code></pre>
