Commit Graph

22 Commits

Author SHA1 Message Date
Moshe Shitrit
0a5b04feea Revert black and only try autopep8 this time 2021-03-21 23:44:32 -04:00
Moshe Shitrit
34b8304d5f autopep8 2021-03-21 23:38:48 -04:00
Moshe Shitrit
0395a10718 Run black linter to make update-pycodestyle happy 2021-03-21 23:27:47 -04:00
Chris Ayoub
ebea7e3430 Fix Watch retries with 410 errors 2021-02-25 00:27:33 -05:00
Nabarun Pal
b68ca30551
Fixes codestyle failures
Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>
2020-07-16 14:08:44 +05:30
Nabarun Pal
a54f404366
Fix a Python 2 compatibility issue
PR #133 introduces the usage of `http` module for checking the status
code for `GONE` HTTP status. However, this doesn't work in Python 2.7.

This commit checks if the interpreter is Python 2 and imports the
status code from `httplib` module instead and unifies the approach
to the checks.

Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>
2020-07-16 14:05:04 +05:30
Mitar
06e48c585c Retry watch if request expires. 2020-07-15 12:27:32 -07:00
Haowei Cai
ea11e44daf watch stream: stop unmarshalling when streaming log 2020-02-21 15:19:35 -08:00
Alexey Volkov
f11587d0e3
Fixed Watch.unmarshal_event when data is not a JSON-serialized object
Fixes https://github.com/kubernetes-client/python/issues/982
Fixes https://github.com/kubernetes-client/python/issues/983
2019-10-17 17:40:20 -07:00
Oz N Tiram
c941d74b37 Remove all shebangs from Python modules and checker
As discussed, Python modules which aren't intended to be invoked
as scripts should not include a shebang line.

Update CONTRIBUTING.md and the checker script.
This script now includes a list SKIP_FILES for files that
should not be checked for boilerplate template.
The tests will now fail if a Python module has a shebang line.
Scripts which should have a shebang line and exists in the directory
`hack` can be ignored by adding them to the SKIP_FILES list.
2019-08-27 22:18:52 +02:00
Mitar
972a76a83d Don't use break inside finally.
It swallows exceptions.
2019-02-20 23:56:38 -08:00
Mitar
ad06e5c923 Added tests. 2019-02-18 16:43:50 -08:00
Mitar
8e6f0435a3 Making watch work with read_namespaced_pod_log.
Fixes https://github.com/kubernetes-client/python/issues/199.
2019-02-11 23:10:33 -08:00
Kubernetes Prow Robot
2d69e89dab
Merge pull request #109 from juliantaylor/fix-watch-reset
fix watching with a specified resource version
2019-01-23 13:10:58 -08:00
Julian Taylor
3c30a30993 fix watching with a specified resource version
The watch code reset the version to the last found in the
response.
When you first list existing objects and then start watching from that
resource version the existing versions are older than the version you
wanted and the watch starts from the wrong version after the first
restart.
This leads to for example already deleted objects ending in the stream
again.

Fix this by setting the minimum resource version to reset from to the
input resource version. As long as k8s returns all objects in order in
the watch this should work.
We cannot use the integer value of the resource version to order it as
one should be treat the value as opaque.

Closes https://github.com/kubernetes-client/python/issues/700
2019-01-23 19:38:44 +01:00
Neha Yadav
d56fdbc0cc Verify Boilerplate fix 2018-12-05 22:22:59 +05:30
Haowei Cai
38cc2658bc Watch properly decode resourceVersion from custom object response 2018-04-27 14:12:41 -07:00
Chen Li
aec1c5259a Update continue the watch with resource_version 2017-10-26 19:45:17 -05:00
Chen Li
8f7b490086 Add flag to enable keep the watch action working all the time
Fixes issue: https://github.com/kubernetes-incubator/client-python/issues/124
2017-10-26 02:14:31 -05:00
Tomasz Prus
c656764766 fix: reset _stop when new stream is called 2017-08-21 00:50:32 +02:00
mbohlool
3b44c3b6a9 Remove loop symlinks 2017-05-19 16:46:39 -07:00
mbohlool
ecb8afa69f Copy over base folder of python-client 2017-05-12 11:08:29 -07:00