Compare commits

...

19 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
0406e1c320
Merge pull request #1838 from yliaog/automated-release-of-24.2.0-upstream-release-24.0-1655852053
Some checks failed
Kubernetes Python Client - Validation / build (3.10) (push) Has been cancelled
Kubernetes Python Client - Validation / build (3.6) (push) Has been cancelled
Kubernetes Python Client - Validation / build (3.7) (push) Has been cancelled
Kubernetes Python Client - Validation / build (3.8) (push) Has been cancelled
Kubernetes Python Client - Validation / build (3.9, coverage) (push) Has been cancelled
Automated release of 24.2.0 upstream release 24.0 1655852053
2022-06-22 11:21:44 -07:00
Yu Liao
7cfc353481 added compatibility matrix for 1.24.2 release. 2022-06-21 22:56:24 +00:00
Yu Liao
9732f83df2 generated client change 2022-06-21 22:55:18 +00:00
Yu Liao
119ecd5dde update version constants for 24.2.0 release 2022-06-21 22:55:18 +00:00
Yu Liao
ec48a0389e update changelog with release notes from master branch 2022-06-21 22:55:18 +00:00
Brendan Burns
1ea21daaac Revert "Add interactive configuration to exec provider."
This reverts commit e0dfc6b0da.
2022-06-21 22:55:18 +00:00
Brendan Burns
59ee3654bc Add interactive configuration to exec provider. 2022-06-21 22:55:18 +00:00
dependabot[bot]
7f3b29d705 Bump helm/kind-action from 1.2.0 to 1.3.0
Bumps [helm/kind-action](https://github.com/helm/kind-action) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/helm/kind-action/releases)
- [Commits](https://github.com/helm/kind-action/compare/v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: helm/kind-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 22:55:18 +00:00
dependabot[bot]
03f84f34f0 Bump actions/setup-python from 3 to 4
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 22:55:18 +00:00
Kubernetes Prow Robot
36bd3ffada
Merge pull request #1827 from yliaog/automated-release-of-24.1.0b1-upstream-release-24.0-1655138958
Automated release of 24.1.0b1 upstream release 24.0 1655138958
2022-06-13 10:34:13 -07:00
Yu Liao
b1deb1477d generated client change 2022-06-13 17:26:02 +00:00
Yu Liao
6e8b82b314 update version constants for 24.1.0b1 release 2022-06-13 17:26:02 +00:00
Yu Liao
b681a1019c update changelog with release notes from master branch 2022-06-13 17:26:02 +00:00
Patrick J McNerthney
97936e3ab6 It turns out SSL sockets can buffer data such that the select method is not aware of it. See:
https://docs.python.org/3/library/ssl.html#notes-on-non-blocking-sockets
  https://docs.python.org/3/library/ssl.html#ssl.SSLSocket.pending
2022-06-13 17:26:02 +00:00
Kubernetes Prow Robot
26267a91e0
Merge pull request #1819 from yliaog/automated-release-of-24.1.0a1-upstream-release-24.0-1654552395
Automated release of 24.1.0a1 upstream release 24.0 1654552395
2022-06-06 15:28:22 -07:00
Yu Liao
6b7546ccf4 added compatibility for 1.24.1 2022-06-06 22:07:53 +00:00
Yu Liao
0597511e64 generated client change 2022-06-06 21:53:44 +00:00
Yu Liao
37b30f61f5 update changelog 2022-06-06 21:53:18 +00:00
Yu Liao
c7b928c260 update version constants for 24.1.0a1 release 2022-06-06 21:53:18 +00:00
18 changed files with 162 additions and 140 deletions

View File

@ -19,7 +19,7 @@ jobs:
with: with:
submodules: true submodules: true
- name: Create Kind Cluster - name: Create Kind Cluster
uses: helm/kind-action@v1.2.0 uses: helm/kind-action@v1.3.0
with: with:
cluster_name: kubernetes-python-e2e-master-${{ matrix.python-version }} cluster_name: kubernetes-python-e2e-master-${{ matrix.python-version }}
# The kind version to be used to spin the cluster up # The kind version to be used to spin the cluster up
@ -30,7 +30,7 @@ jobs:
# as we sync with Kubernetes upstream # as we sync with Kubernetes upstream
config: .github/workflows/kind-configs/cluster-1.18.yaml config: .github/workflows/kind-configs/cluster-1.18.yaml
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies

View File

@ -19,7 +19,7 @@ jobs:
with: with:
submodules: true submodules: true
- name: Create Kind Cluster - name: Create Kind Cluster
uses: helm/kind-action@v1.2.0 uses: helm/kind-action@v1.3.0
with: with:
cluster_name: kubernetes-python-e2e-release-11.0-${{ matrix.python-version }} cluster_name: kubernetes-python-e2e-release-11.0-${{ matrix.python-version }}
# The kind version to be used to spin the cluster up # The kind version to be used to spin the cluster up
@ -30,7 +30,7 @@ jobs:
# as we sync with Kubernetes upstream # as we sync with Kubernetes upstream
config: .github/workflows/kind-configs/cluster-1.15.yaml config: .github/workflows/kind-configs/cluster-1.15.yaml
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies

View File

@ -19,7 +19,7 @@ jobs:
with: with:
submodules: true submodules: true
- name: Create Kind Cluster - name: Create Kind Cluster
uses: helm/kind-action@v1.2.0 uses: helm/kind-action@v1.3.0
with: with:
cluster_name: kubernetes-python-e2e-release-12.0-${{ matrix.python-version }} cluster_name: kubernetes-python-e2e-release-12.0-${{ matrix.python-version }}
# The kind version to be used to spin the cluster up # The kind version to be used to spin the cluster up
@ -30,7 +30,7 @@ jobs:
# as we sync with Kubernetes upstream # as we sync with Kubernetes upstream
config: .github/workflows/kind-configs/cluster-1.16.yaml config: .github/workflows/kind-configs/cluster-1.16.yaml
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies

View File

@ -19,7 +19,7 @@ jobs:
with: with:
submodules: true submodules: true
- name: Create Kind Cluster - name: Create Kind Cluster
uses: helm/kind-action@v1.2.0 uses: helm/kind-action@v1.3.0
with: with:
cluster_name: kubernetes-python-e2e-release-17.0-${{ matrix.python-version }} cluster_name: kubernetes-python-e2e-release-17.0-${{ matrix.python-version }}
# The kind version to be used to spin the cluster up # The kind version to be used to spin the cluster up
@ -30,7 +30,7 @@ jobs:
# as we sync with Kubernetes upstream # as we sync with Kubernetes upstream
config: .github/workflows/kind-configs/cluster-1.17.yaml config: .github/workflows/kind-configs/cluster-1.17.yaml
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies

View File

@ -19,7 +19,7 @@ jobs:
with: with:
submodules: true submodules: true
- name: Create Kind Cluster - name: Create Kind Cluster
uses: helm/kind-action@v1.2.0 uses: helm/kind-action@v1.3.0
with: with:
cluster_name: kubernetes-python-e2e-release-18.0-${{ matrix.python-version }} cluster_name: kubernetes-python-e2e-release-18.0-${{ matrix.python-version }}
# The kind version to be used to spin the cluster up # The kind version to be used to spin the cluster up
@ -30,7 +30,7 @@ jobs:
# as we sync with Kubernetes upstream # as we sync with Kubernetes upstream
config: .github/workflows/kind-configs/cluster-1.18.yaml config: .github/workflows/kind-configs/cluster-1.18.yaml
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies

View File

@ -17,7 +17,7 @@ jobs:
with: with:
submodules: true submodules: true
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies

View File

@ -1,4 +1,18 @@
# v24.0.0-snapshot # v24.2.0
Kubernetes API Version: v1.24.2
### Uncategorized
- The dynamic client now support the `_request_timeout` parameter to configure connection and request timeouts. (#1732, @philipp-sontag-by)
# v24.1.0b1
Kubernetes API Version: v1.24.1
### Uncategorized
- The dynamic client now support the `_request_timeout` parameter to configure connection and request timeouts. (#1732, @philipp-sontag-by)
# v24.1.0a1
Kubernetes API Version: v1.24.1 Kubernetes API Version: v1.24.1

View File

@ -93,6 +93,7 @@ supported versions of Kubernetes clusters.
- [client 21.y.z](https://pypi.org/project/kubernetes/21.7.0/): Kubernetes 1.20 or below (+-), Kubernetes 1.21 (✓), Kubernetes 1.22 or above (+-) - [client 21.y.z](https://pypi.org/project/kubernetes/21.7.0/): Kubernetes 1.20 or below (+-), Kubernetes 1.21 (✓), Kubernetes 1.22 or above (+-)
- [client 22.y.z](https://pypi.org/project/kubernetes/22.6.0/): Kubernetes 1.21 or below (+-), Kubernetes 1.22 (✓), Kubernetes 1.23 or above (+-) - [client 22.y.z](https://pypi.org/project/kubernetes/22.6.0/): Kubernetes 1.21 or below (+-), Kubernetes 1.22 (✓), Kubernetes 1.23 or above (+-)
- [client 23.y.z](https://pypi.org/project/kubernetes/23.6.0/): Kubernetes 1.22 or below (+-), Kubernetes 1.23 (✓), Kubernetes 1.24 or above (+-) - [client 23.y.z](https://pypi.org/project/kubernetes/23.6.0/): Kubernetes 1.22 or below (+-), Kubernetes 1.23 (✓), Kubernetes 1.24 or above (+-)
- [client 24.y.z](https://pypi.org/project/kubernetes/24.2.0/): Kubernetes 1.23 or below (+-), Kubernetes 1.24 (✓), Kubernetes 1.25 or above (+-)
> See [here](#homogenizing-the-kubernetes-python-client-versions) for an explanation of why there is no v13-v16 release. > See [here](#homogenizing-the-kubernetes-python-client-versions) for an explanation of why there is no v13-v16 release.
@ -138,11 +139,13 @@ between client-python versions.
| 20.0 Alpha/Beta | Kubernetes main repo, 1.20 branch | ✗ | | 20.0 Alpha/Beta | Kubernetes main repo, 1.20 branch | ✗ |
| 20.0 | Kubernetes main repo, 1.20 branch | ✗ | | 20.0 | Kubernetes main repo, 1.20 branch | ✗ |
| 21.0 Alpha/Beta | Kubernetes main repo, 1.21 branch | ✗ | | 21.0 Alpha/Beta | Kubernetes main repo, 1.21 branch | ✗ |
| 21.0 | Kubernetes main repo, 1.21 branch | | | 21.0 | Kubernetes main repo, 1.21 branch | |
| 22.0 Alpha/Beta | Kubernetes main repo, 1.22 branch | ✗ | | 22.0 Alpha/Beta | Kubernetes main repo, 1.22 branch | ✗ |
| 22.0 | Kubernetes main repo, 1.22 branch | ✓ | | 22.0 | Kubernetes main repo, 1.22 branch | ✓ |
| 23.0 Alpha/Beta | Kubernetes main repo, 1.23 branch | ✗ | | 23.0 Alpha/Beta | Kubernetes main repo, 1.23 branch | ✗ |
| 23.0 | Kubernetes main repo, 1.23 branch | ✓ | | 23.0 | Kubernetes main repo, 1.23 branch | ✓ |
| 24.0 Alpha/Beta | Kubernetes main repo, 1.24 branch | ✗ |
| 24.0 | Kubernetes main repo, 1.24 branch | ✓ |
> See [here](#homogenizing-the-kubernetes-python-client-versions) for an explanation of why there is no v13-v16 release. > See [here](#homogenizing-the-kubernetes-python-client-versions) for an explanation of why there is no v13-v16 release.

View File

@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: release-1.24 - API version: release-1.24
- Package version: 24.0.0-snapshot - Package version: 24.2.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen - Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements. ## Requirements.

View File

@ -14,7 +14,7 @@
__project__ = 'kubernetes' __project__ = 'kubernetes'
# The version is auto-updated. Please do not edit. # The version is auto-updated. Please do not edit.
__version__ = "24.0.0-snapshot" __version__ = "24.2.0"
import kubernetes.client import kubernetes.client
import kubernetes.config import kubernetes.config

View File

@ -353,23 +353,25 @@ class PortForward:
local_all_closed = True local_all_closed = True
for port in self.local_ports.values(): for port in self.local_ports.values():
if port.python.fileno() != -1: if port.python.fileno() != -1:
if port.error or not self.websocket.connected: if self.websocket.connected:
rlist.append(port.python)
if port.data:
wlist.append(port.python)
local_all_closed = False
else:
if port.data: if port.data:
wlist.append(port.python) wlist.append(port.python)
local_all_closed = False local_all_closed = False
else: else:
port.python.close() port.python.close()
else:
rlist.append(port.python)
if port.data:
wlist.append(port.python)
local_all_closed = False
if local_all_closed and not (self.websocket.connected and kubernetes_data): if local_all_closed and not (self.websocket.connected and kubernetes_data):
self.websocket.close() self.websocket.close()
return return
r, w, _ = select.select(rlist, wlist, []) r, w, _ = select.select(rlist, wlist, [])
for sock in r: for sock in r:
if sock == self.websocket: if sock == self.websocket:
pending = True
while pending:
opcode, frame = self.websocket.recv_data_frame(True) opcode, frame = self.websocket.recv_data_frame(True)
if opcode == ABNF.OPCODE_BINARY: if opcode == ABNF.OPCODE_BINARY:
if not frame.data: if not frame.data:
@ -383,6 +385,7 @@ class PortForward:
if port.error is None: if port.error is None:
port.error = '' port.error = ''
port.error += frame.data[1:].decode() port.error += frame.data[1:].decode()
port.python.close()
else: else:
port.data += frame.data[1:] port.data += frame.data[1:]
else: else:
@ -398,8 +401,11 @@ class PortForward:
channel_initialized[channel] = True channel_initialized[channel] = True
elif opcode not in (ABNF.OPCODE_PING, ABNF.OPCODE_PONG, ABNF.OPCODE_CLOSE): elif opcode not in (ABNF.OPCODE_PING, ABNF.OPCODE_PONG, ABNF.OPCODE_CLOSE):
raise RuntimeError("Unexpected websocket opcode: %s" % opcode) raise RuntimeError("Unexpected websocket opcode: %s" % opcode)
if not (isinstance(self.websocket.sock, ssl.SSLSocket) and self.websocket.sock.pending()):
pending = False
else: else:
port = local_ports[sock] port = local_ports[sock]
if port.python.fileno() != -1:
data = port.python.recv(1024 * 1024) data = port.python.recv(1024 * 1024)
if data: if data:
kubernetes_data += ABNF.create_frame( kubernetes_data += ABNF.create_frame(
@ -414,6 +420,7 @@ class PortForward:
kubernetes_data = kubernetes_data[sent:] kubernetes_data = kubernetes_data[sent:]
else: else:
port = local_ports[sock] port = local_ports[sock]
if port.python.fileno() != -1:
sent = port.python.send(port.data) sent = port.python.send(port.data)
port.data = port.data[sent:] port.data = port.data[sent:]

View File

@ -14,7 +14,7 @@
from __future__ import absolute_import from __future__ import absolute_import
__version__ = "24.0.0-snapshot" __version__ = "24.2.0"
# import apis into sdk package # import apis into sdk package
from kubernetes.client.api.well_known_api import WellKnownApi from kubernetes.client.api.well_known_api import WellKnownApi

View File

@ -78,7 +78,7 @@ class ApiClient(object):
self.default_headers[header_name] = header_value self.default_headers[header_name] = header_value
self.cookie = cookie self.cookie = cookie
# Set default User-Agent. # Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/24.0.0-snapshot/python' self.user_agent = 'OpenAPI-Generator/24.2.0/python'
self.client_side_validation = configuration.client_side_validation self.client_side_validation = configuration.client_side_validation
def __enter__(self): def __enter__(self):

View File

@ -350,7 +350,7 @@ class Configuration(object):
"OS: {env}\n"\ "OS: {env}\n"\
"Python Version: {pyversion}\n"\ "Python Version: {pyversion}\n"\
"Version of the API: release-1.24\n"\ "Version of the API: release-1.24\n"\
"SDK Package Version: 24.0.0-snapshot".\ "SDK Package Version: 24.2.0".\
format(env=sys.platform, pyversion=sys.version) format(env=sys.platform, pyversion=sys.version)
def get_host_settings(self): def get_host_settings(self):

View File

@ -1,5 +1,3 @@
#!/usr/bin/env python
import select import select
import socketserver import socketserver
import sys import sys
@ -28,6 +26,7 @@ class PortServer:
data = request.recv(1024) data = request.recv(1024)
if not data: if not data:
break break
print(f"{self.port}: {data}\n", end='', flush=True)
echo += data echo += data
if w: if w:
echo = echo[request.send(echo):] echo = echo[request.send(echo):]
@ -38,4 +37,3 @@ if __name__ == '__main__':
for port in sys.argv[1:]: for port in sys.argv[1:]:
ports.append(PortServer(int(port))) ports.append(PortServer(int(port)))
time.sleep(10 * 60) time.sleep(10 * 60)

View File

@ -230,10 +230,6 @@ class TestClient(unittest.TestCase):
resp = api.delete_namespaced_pod(name=name, body={}, resp = api.delete_namespaced_pod(name=name, body={},
namespace='default') namespace='default')
# Skipping this test as this flakes a lot
# See: https://github.com/kubernetes-client/python/issues/1300
# Re-enable the test once the flakiness is investigated
@unittest.skip("skipping due to extreme flakiness")
def test_portforward_raw(self): def test_portforward_raw(self):
client = api_client.ApiClient(configuration=self.config) client = api_client.ApiClient(configuration=self.config)
api = core_v1_api.CoreV1Api(client) api = core_v1_api.CoreV1Api(client)
@ -267,7 +263,7 @@ class TestClient(unittest.TestCase):
'name': 'port-server', 'name': 'port-server',
'image': 'python', 'image': 'python',
'command': [ 'command': [
'/opt/port-server.py', '1234', '1235', 'python', '-u', '/opt/port-server.py', '1234', '1235',
], ],
'volumeMounts': [ 'volumeMounts': [
{ {
@ -278,17 +274,19 @@ class TestClient(unittest.TestCase):
], ],
'startupProbe': { 'startupProbe': {
'tcpSocket': { 'tcpSocket': {
'port': 1234, 'port': 1235,
}, },
'periodSeconds': 1,
'failureThreshold': 30,
}, },
}, },
], ],
'restartPolicy': 'Never',
'volumes': [ 'volumes': [
{ {
'name': 'port-server', 'name': 'port-server',
'configMap': { 'configMap': {
'name': name, 'name': name,
'defaultMode': 0o777,
}, },
}, },
], ],
@ -299,16 +297,21 @@ class TestClient(unittest.TestCase):
self.assertEqual(name, resp.metadata.name) self.assertEqual(name, resp.metadata.name)
self.assertTrue(resp.status.phase) self.assertTrue(resp.status.phase)
timeout = time.time() + 60
while True: while True:
resp = api.read_namespaced_pod(name=name, resp = api.read_namespaced_pod(name=name,
namespace='default') namespace='default')
self.assertEqual(name, resp.metadata.name) self.assertEqual(name, resp.metadata.name)
self.assertTrue(resp.status.phase) if resp.status.phase == 'Running':
if resp.status.phase != 'Pending': if resp.status.container_statuses[0].ready:
break break
else:
self.assertEqual(resp.status.phase, 'Pending')
self.assertTrue(time.time() < timeout)
time.sleep(1) time.sleep(1)
self.assertEqual(resp.status.phase, 'Running')
for ix in range(10):
ix = str(ix + 1).encode()
pf = portforward(api.connect_get_namespaced_pod_portforward, pf = portforward(api.connect_get_namespaced_pod_portforward,
name, 'default', name, 'default',
ports='1234,1235,1236') ports='1234,1235,1236')
@ -317,54 +320,51 @@ class TestClient(unittest.TestCase):
sock1235 = pf.socket(1235) sock1235 = pf.socket(1235)
sock1234.setblocking(True) sock1234.setblocking(True)
sock1235.setblocking(True) sock1235.setblocking(True)
sent1234 = b'Test port 1234 forwarding...' sent1234 = b'Test ' + ix + b' port 1234 forwarding'
sent1235 = b'Test port 1235 forwarding...' sent1235 = b'Test ' + ix + b' port 1235 forwarding'
sock1234.sendall(sent1234) sock1234.sendall(sent1234)
sock1235.sendall(sent1235) sock1235.sendall(sent1235)
reply1234 = b'' reply1234 = b''
reply1235 = b'' reply1235 = b''
while True: timeout = time.time() + 60
rlist = [] while reply1234 != sent1234 or reply1235 != sent1235:
if sock1234.fileno() != -1: self.assertNotEqual(sock1234.fileno(), -1)
rlist.append(sock1234) self.assertNotEqual(sock1235.fileno(), -1)
if sock1235.fileno() != -1: self.assertTrue(time.time() < timeout)
rlist.append(sock1235) r, _w, _x = select.select([sock1234, sock1235], [], [], 1)
if not rlist:
break
r, _w, _x = select.select(rlist, [], [], 1)
if not r:
break
if sock1234 in r: if sock1234 in r:
data = sock1234.recv(1024) data = sock1234.recv(1024)
self.assertNotEqual(data, b'', "Unexpected socket close") self.assertNotEqual(data, b'', 'Unexpected socket close')
reply1234 += data reply1234 += data
self.assertTrue(sent1234.startswith(reply1234))
if sock1235 in r: if sock1235 in r:
data = sock1235.recv(1024) data = sock1235.recv(1024)
self.assertNotEqual(data, b'', "Unexpected socket close") self.assertNotEqual(data, b'', 'Unexpected socket close')
reply1235 += data reply1235 += data
self.assertEqual(reply1234, sent1234) self.assertTrue(sent1235.startswith(reply1235))
self.assertEqual(reply1235, sent1235)
self.assertTrue(pf.connected) self.assertTrue(pf.connected)
sock = pf.socket(1236) sock = pf.socket(1236)
self.assertRaises(socket.error, sock.sendall, b'This should fail...') sock.setblocking(True)
self.assertEqual(sock.recv(1024), b'')
self.assertIsNotNone(pf.error(1236)) self.assertIsNotNone(pf.error(1236))
sock.close() sock.close()
for sock in (sock1234, sock1235): for sock in (sock1234, sock1235):
self.assertTrue(pf.connected) self.assertTrue(pf.connected)
sent = b'Another test using fileno %s' % str( sent = b'Another test ' + ix + b' using fileno ' + str(sock.fileno()).encode()
sock.fileno()).encode()
sock.sendall(sent) sock.sendall(sent)
reply = b'' reply = b''
while True: timeout = time.time() + 60
while reply != sent:
self.assertNotEqual(sock.fileno(), -1)
self.assertTrue(time.time() < timeout)
r, _w, _x = select.select([sock], [], [], 1) r, _w, _x = select.select([sock], [], [], 1)
if not r: if r:
break
data = sock.recv(1024) data = sock.recv(1024)
self.assertNotEqual(data, b'', "Unexpected socket close") self.assertNotEqual(data, b'', 'Unexpected socket close')
reply += data reply += data
self.assertEqual(reply, sent) self.assertTrue(sent.startswith(reply))
sock.close() sock.close()
time.sleep(1) time.sleep(1)
self.assertFalse(pf.connected) self.assertFalse(pf.connected)

View File

@ -18,13 +18,13 @@ import sys
KUBERNETES_BRANCH = "release-1.24" KUBERNETES_BRANCH = "release-1.24"
# client version for packaging and releasing. # client version for packaging and releasing.
CLIENT_VERSION = "24.0.0-snapshot" CLIENT_VERSION = "24.2.0"
# Name of the release package # Name of the release package
PACKAGE_NAME = "kubernetes" PACKAGE_NAME = "kubernetes"
# Stage of development, mainly used in setup.py's classifiers. # Stage of development, mainly used in setup.py's classifiers.
DEVELOPMENT_STATUS = "3 - Alpha" DEVELOPMENT_STATUS = "5 - Production/Stable"
# If called directly, return the constant value given # If called directly, return the constant value given

View File

@ -16,9 +16,9 @@ from setuptools import setup
# Do not edit these constants. They will be updated automatically # Do not edit these constants. They will be updated automatically
# by scripts/update-client.sh. # by scripts/update-client.sh.
CLIENT_VERSION = "24.0.0-snapshot" CLIENT_VERSION = "24.2.0"
PACKAGE_NAME = "kubernetes" PACKAGE_NAME = "kubernetes"
DEVELOPMENT_STATUS = "3 - Alpha" DEVELOPMENT_STATUS = "5 - Production/Stable"
# To install the library, run the following # To install the library, run the following
# #