Compare commits
19 Commits
master
...
release-24
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0406e1c320 | ||
|
|
7cfc353481 | ||
|
|
9732f83df2 | ||
|
|
119ecd5dde | ||
|
|
ec48a0389e | ||
|
|
1ea21daaac | ||
|
|
59ee3654bc | ||
|
|
7f3b29d705 | ||
|
|
03f84f34f0 | ||
|
|
36bd3ffada | ||
|
|
b1deb1477d | ||
|
|
6e8b82b314 | ||
|
|
b681a1019c | ||
|
|
97936e3ab6 | ||
|
|
26267a91e0 | ||
|
|
6b7546ccf4 | ||
|
|
0597511e64 | ||
|
|
37b30f61f5 | ||
|
|
c7b928c260 |
4
.github/workflows/e2e-master.yaml
vendored
4
.github/workflows/e2e-master.yaml
vendored
@ -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
|
||||||
|
|||||||
4
.github/workflows/e2e-release-11.0.yaml
vendored
4
.github/workflows/e2e-release-11.0.yaml
vendored
@ -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
|
||||||
|
|||||||
4
.github/workflows/e2e-release-12.0.yaml
vendored
4
.github/workflows/e2e-release-12.0.yaml
vendored
@ -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
|
||||||
|
|||||||
4
.github/workflows/e2e-release-17.0.yaml
vendored
4
.github/workflows/e2e-release-17.0.yaml
vendored
@ -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
|
||||||
|
|||||||
4
.github/workflows/e2e-release-18.0.yaml
vendored
4
.github/workflows/e2e-release-18.0.yaml
vendored
@ -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
|
||||||
|
|||||||
2
.github/workflows/test.yaml
vendored
2
.github/workflows/test.yaml
vendored
@ -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
|
||||||
|
|||||||
16
CHANGELOG.md
16
CHANGELOG.md
@ -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
|
||||||
|
|
||||||
|
|||||||
@ -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.
|
||||||
|
|
||||||
|
|||||||
@ -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.
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -353,69 +353,76 @@ 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:
|
||||||
opcode, frame = self.websocket.recv_data_frame(True)
|
pending = True
|
||||||
if opcode == ABNF.OPCODE_BINARY:
|
while pending:
|
||||||
if not frame.data:
|
opcode, frame = self.websocket.recv_data_frame(True)
|
||||||
raise RuntimeError("Unexpected frame data size")
|
if opcode == ABNF.OPCODE_BINARY:
|
||||||
channel = six.byte2int(frame.data)
|
if not frame.data:
|
||||||
if channel >= len(channel_ports):
|
raise RuntimeError("Unexpected frame data size")
|
||||||
raise RuntimeError("Unexpected channel number: %s" % channel)
|
channel = six.byte2int(frame.data)
|
||||||
port = channel_ports[channel]
|
if channel >= len(channel_ports):
|
||||||
if channel_initialized[channel]:
|
raise RuntimeError("Unexpected channel number: %s" % channel)
|
||||||
if channel % 2:
|
port = channel_ports[channel]
|
||||||
if port.error is None:
|
if channel_initialized[channel]:
|
||||||
port.error = ''
|
if channel % 2:
|
||||||
port.error += frame.data[1:].decode()
|
if port.error is None:
|
||||||
|
port.error = ''
|
||||||
|
port.error += frame.data[1:].decode()
|
||||||
|
port.python.close()
|
||||||
|
else:
|
||||||
|
port.data += frame.data[1:]
|
||||||
else:
|
else:
|
||||||
port.data += frame.data[1:]
|
if len(frame.data) != 3:
|
||||||
else:
|
raise RuntimeError(
|
||||||
if len(frame.data) != 3:
|
"Unexpected initial channel frame data size"
|
||||||
raise RuntimeError(
|
)
|
||||||
"Unexpected initial channel frame data size"
|
port_number = six.byte2int(frame.data[1:2]) + (six.byte2int(frame.data[2:3]) * 256)
|
||||||
)
|
if port_number != port.port_number:
|
||||||
port_number = six.byte2int(frame.data[1:2]) + (six.byte2int(frame.data[2:3]) * 256)
|
raise RuntimeError(
|
||||||
if port_number != port.port_number:
|
"Unexpected port number in initial channel frame: %s" % port_number
|
||||||
raise RuntimeError(
|
)
|
||||||
"Unexpected port number in initial channel frame: %s" % port_number
|
channel_initialized[channel] = True
|
||||||
)
|
elif opcode not in (ABNF.OPCODE_PING, ABNF.OPCODE_PONG, ABNF.OPCODE_CLOSE):
|
||||||
channel_initialized[channel] = True
|
raise RuntimeError("Unexpected websocket opcode: %s" % opcode)
|
||||||
elif opcode not in (ABNF.OPCODE_PING, ABNF.OPCODE_PONG, ABNF.OPCODE_CLOSE):
|
if not (isinstance(self.websocket.sock, ssl.SSLSocket) and self.websocket.sock.pending()):
|
||||||
raise RuntimeError("Unexpected websocket opcode: %s" % opcode)
|
pending = False
|
||||||
else:
|
else:
|
||||||
port = local_ports[sock]
|
port = local_ports[sock]
|
||||||
data = port.python.recv(1024 * 1024)
|
if port.python.fileno() != -1:
|
||||||
if data:
|
data = port.python.recv(1024 * 1024)
|
||||||
kubernetes_data += ABNF.create_frame(
|
if data:
|
||||||
port.channel + data,
|
kubernetes_data += ABNF.create_frame(
|
||||||
ABNF.OPCODE_BINARY,
|
port.channel + data,
|
||||||
).format()
|
ABNF.OPCODE_BINARY,
|
||||||
else:
|
).format()
|
||||||
port.python.close()
|
else:
|
||||||
|
port.python.close()
|
||||||
for sock in w:
|
for sock in w:
|
||||||
if sock == self.websocket:
|
if sock == self.websocket:
|
||||||
sent = self.websocket.sock.send(kubernetes_data)
|
sent = self.websocket.sock.send(kubernetes_data)
|
||||||
kubernetes_data = kubernetes_data[sent:]
|
kubernetes_data = kubernetes_data[sent:]
|
||||||
else:
|
else:
|
||||||
port = local_ports[sock]
|
port = local_ports[sock]
|
||||||
sent = port.python.send(port.data)
|
if port.python.fileno() != -1:
|
||||||
port.data = port.data[sent:]
|
sent = port.python.send(port.data)
|
||||||
|
port.data = port.data[sent:]
|
||||||
|
|
||||||
|
|
||||||
def get_websocket_url(url, query_params=None):
|
def get_websocket_url(url, query_params=None):
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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):
|
||||||
|
|||||||
@ -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):
|
||||||
|
|||||||
@ -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)
|
||||||
|
|
||||||
|
|||||||
@ -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,77 +297,79 @@ 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
|
|
||||||
time.sleep(1)
|
|
||||||
self.assertEqual(resp.status.phase, 'Running')
|
|
||||||
|
|
||||||
pf = portforward(api.connect_get_namespaced_pod_portforward,
|
|
||||||
name, 'default',
|
|
||||||
ports='1234,1235,1236')
|
|
||||||
self.assertTrue(pf.connected)
|
|
||||||
sock1234 = pf.socket(1234)
|
|
||||||
sock1235 = pf.socket(1235)
|
|
||||||
sock1234.setblocking(True)
|
|
||||||
sock1235.setblocking(True)
|
|
||||||
sent1234 = b'Test port 1234 forwarding...'
|
|
||||||
sent1235 = b'Test port 1235 forwarding...'
|
|
||||||
sock1234.sendall(sent1234)
|
|
||||||
sock1235.sendall(sent1235)
|
|
||||||
reply1234 = b''
|
|
||||||
reply1235 = b''
|
|
||||||
while True:
|
|
||||||
rlist = []
|
|
||||||
if sock1234.fileno() != -1:
|
|
||||||
rlist.append(sock1234)
|
|
||||||
if sock1235.fileno() != -1:
|
|
||||||
rlist.append(sock1235)
|
|
||||||
if not rlist:
|
|
||||||
break
|
|
||||||
r, _w, _x = select.select(rlist, [], [], 1)
|
|
||||||
if not r:
|
|
||||||
break
|
|
||||||
if sock1234 in r:
|
|
||||||
data = sock1234.recv(1024)
|
|
||||||
self.assertNotEqual(data, b'', "Unexpected socket close")
|
|
||||||
reply1234 += data
|
|
||||||
if sock1235 in r:
|
|
||||||
data = sock1235.recv(1024)
|
|
||||||
self.assertNotEqual(data, b'', "Unexpected socket close")
|
|
||||||
reply1235 += data
|
|
||||||
self.assertEqual(reply1234, sent1234)
|
|
||||||
self.assertEqual(reply1235, sent1235)
|
|
||||||
self.assertTrue(pf.connected)
|
|
||||||
|
|
||||||
sock = pf.socket(1236)
|
|
||||||
self.assertRaises(socket.error, sock.sendall, b'This should fail...')
|
|
||||||
self.assertIsNotNone(pf.error(1236))
|
|
||||||
sock.close()
|
|
||||||
|
|
||||||
for sock in (sock1234, sock1235):
|
|
||||||
self.assertTrue(pf.connected)
|
|
||||||
sent = b'Another test using fileno %s' % str(
|
|
||||||
sock.fileno()).encode()
|
|
||||||
sock.sendall(sent)
|
|
||||||
reply = b''
|
|
||||||
while True:
|
|
||||||
r, _w, _x = select.select([sock], [], [], 1)
|
|
||||||
if not r:
|
|
||||||
break
|
break
|
||||||
data = sock.recv(1024)
|
else:
|
||||||
self.assertNotEqual(data, b'', "Unexpected socket close")
|
self.assertEqual(resp.status.phase, 'Pending')
|
||||||
reply += data
|
self.assertTrue(time.time() < timeout)
|
||||||
self.assertEqual(reply, sent)
|
time.sleep(1)
|
||||||
|
|
||||||
|
for ix in range(10):
|
||||||
|
ix = str(ix + 1).encode()
|
||||||
|
pf = portforward(api.connect_get_namespaced_pod_portforward,
|
||||||
|
name, 'default',
|
||||||
|
ports='1234,1235,1236')
|
||||||
|
self.assertTrue(pf.connected)
|
||||||
|
sock1234 = pf.socket(1234)
|
||||||
|
sock1235 = pf.socket(1235)
|
||||||
|
sock1234.setblocking(True)
|
||||||
|
sock1235.setblocking(True)
|
||||||
|
sent1234 = b'Test ' + ix + b' port 1234 forwarding'
|
||||||
|
sent1235 = b'Test ' + ix + b' port 1235 forwarding'
|
||||||
|
sock1234.sendall(sent1234)
|
||||||
|
sock1235.sendall(sent1235)
|
||||||
|
reply1234 = b''
|
||||||
|
reply1235 = b''
|
||||||
|
timeout = time.time() + 60
|
||||||
|
while reply1234 != sent1234 or reply1235 != sent1235:
|
||||||
|
self.assertNotEqual(sock1234.fileno(), -1)
|
||||||
|
self.assertNotEqual(sock1235.fileno(), -1)
|
||||||
|
self.assertTrue(time.time() < timeout)
|
||||||
|
r, _w, _x = select.select([sock1234, sock1235], [], [], 1)
|
||||||
|
if sock1234 in r:
|
||||||
|
data = sock1234.recv(1024)
|
||||||
|
self.assertNotEqual(data, b'', 'Unexpected socket close')
|
||||||
|
reply1234 += data
|
||||||
|
self.assertTrue(sent1234.startswith(reply1234))
|
||||||
|
if sock1235 in r:
|
||||||
|
data = sock1235.recv(1024)
|
||||||
|
self.assertNotEqual(data, b'', 'Unexpected socket close')
|
||||||
|
reply1235 += data
|
||||||
|
self.assertTrue(sent1235.startswith(reply1235))
|
||||||
|
self.assertTrue(pf.connected)
|
||||||
|
|
||||||
|
sock = pf.socket(1236)
|
||||||
|
sock.setblocking(True)
|
||||||
|
self.assertEqual(sock.recv(1024), b'')
|
||||||
|
self.assertIsNotNone(pf.error(1236))
|
||||||
sock.close()
|
sock.close()
|
||||||
time.sleep(1)
|
|
||||||
self.assertFalse(pf.connected)
|
for sock in (sock1234, sock1235):
|
||||||
self.assertIsNone(pf.error(1234))
|
self.assertTrue(pf.connected)
|
||||||
self.assertIsNone(pf.error(1235))
|
sent = b'Another test ' + ix + b' using fileno ' + str(sock.fileno()).encode()
|
||||||
|
sock.sendall(sent)
|
||||||
|
reply = b''
|
||||||
|
timeout = time.time() + 60
|
||||||
|
while reply != sent:
|
||||||
|
self.assertNotEqual(sock.fileno(), -1)
|
||||||
|
self.assertTrue(time.time() < timeout)
|
||||||
|
r, _w, _x = select.select([sock], [], [], 1)
|
||||||
|
if r:
|
||||||
|
data = sock.recv(1024)
|
||||||
|
self.assertNotEqual(data, b'', 'Unexpected socket close')
|
||||||
|
reply += data
|
||||||
|
self.assertTrue(sent.startswith(reply))
|
||||||
|
sock.close()
|
||||||
|
time.sleep(1)
|
||||||
|
self.assertFalse(pf.connected)
|
||||||
|
self.assertIsNone(pf.error(1234))
|
||||||
|
self.assertIsNone(pf.error(1235))
|
||||||
|
|
||||||
resp = api.delete_namespaced_pod(name=name, namespace='default')
|
resp = api.delete_namespaced_pod(name=name, namespace='default')
|
||||||
resp = api.delete_namespaced_config_map(name=name, namespace='default')
|
resp = api.delete_namespaced_config_map(name=name, namespace='default')
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
4
setup.py
4
setup.py
@ -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
|
||||||
#
|
#
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user