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>
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.
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