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
What happened (please include outputs or screenshots):
Iterating the return value of Watch().stream() raises an exception when a bookmark event is received. It successfully iterates events prior to the bookmark being received.
File ". . .", line 43, in . . .
value = next(iterator)
File "/usr/local/lib/python3.8/site-packages/kubernetes/watch/watch.py", line 163, in stream
event = self.unmarshal_event(line, return_type)
File "/usr/local/lib/python3.8/site-packages/kubernetes/watch/watch.py", line 101, in unmarshal_event
js['object'] = self._api_client.deserialize(obj, return_type)
File "/usr/local/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 264, in deserialize
return self.__deserialize(data, response_type)
File "/usr/local/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 303, in __deserialize
return self.__deserialize_model(data, klass)
File "/usr/local/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 639, in __deserialize_model
kwargs[attr] = self.__deserialize(value, attr_type)
File "/usr/local/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 303, in __deserialize
return self.__deserialize_model(data, klass)
File "/usr/local/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 639, in __deserialize_model
kwargs[attr] = self.__deserialize(value, attr_type)
File "/usr/local/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 303, in __deserialize
return self.__deserialize_model(data, klass)
File "/usr/local/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 639, in __deserialize_model
kwargs[attr] = self.__deserialize(value, attr_type)
File "/usr/local/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 303, in __deserialize
return self.__deserialize_model(data, klass)
File "/usr/local/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 641, in __deserialize_model
instance = klass(**kwargs)
File "/usr/local/lib/python3.8/site-packages/kubernetes/client/models/v1_pod_spec.py", line 157, in __init__
self.containers = containers
File "/usr/local/lib/python3.8/site-packages/kubernetes/client/models/v1_pod_spec.py", line 307, in containers
raise ValueError("Invalid value for `containers`, must not be `None`") # noqa: E501
What you expected to happen:
The iterator should yield an event like {'type': 'BOOKMARK'} and the Watch instance should note the updated resource version internally.
How to reproduce it (as minimally and precisely as possible):
What happened (please include outputs or screenshots):
Iterating the return value of
Watch().stream()
raises an exception when a bookmark event is received. It successfully iterates events prior to the bookmark being received.Stack trace:
(
iterator = Watch().stream(..., allow_watch_bookmarks=True)
)What you expected to happen:
The iterator should yield an event like
{'type': 'BOOKMARK'}
and theWatch
instance should note the updated resource version internally.How to reproduce it (as minimally and precisely as possible):
Watch
:Anything else we need to know?:
Here's the
data
argument passed toWatch.unmarshal_event()
(via debugger):#1136 has a similar title but it's a different bug which I haven't observed (
Watch()
does work for me until a bookmark event comes through).It seems likely that this affects other types of resources, but I've only tried it with jobs.
Environment:
kubectl version
): Server Version: version.Info{Major:"1", Minor:"18+", GitVersion:"v1.18.9-eks-d1db3c", GitCommit:"d1db3c46e55f95d6a7d3e5578689371318f95ff9", GitTreeState:"clean", BuildDate:"2020-10-20T22:18:07Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}python --version
): Python 3.8.8pip list | grep kubernetes
): kubernetes==12.0.1The text was updated successfully, but these errors were encountered: