Skip to content

Commit bca04f8

Browse files
committed
Upgrade to kubernetes v36 and fix ApiClient.__new__ incompatibility
kubernetes v36.0.0 changed ApiClient.__deserialize_model() to access self.configuration. Constructing ApiClient via __new__() bypasses __init__ and leaves configuration unset, causing AttributeError at deserialization time. Replace ApiClient.__new__(ApiClient) with ApiClient() in both _kubernetes_serialize and _kubernetes_deserialize so that __init__ runs and configuration is properly initialized.
1 parent ae6568b commit bca04f8

3 files changed

Lines changed: 15 additions & 10 deletions

File tree

cloud_pipelines_backend/launchers/kubernetes_launchers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,13 +1778,13 @@ def windows_path_to_docker_path(path: str) -> str:
17781778

17791779

17801780
def _kubernetes_serialize(obj) -> dict[str, Any]:
1781-
shallow_client = k8s_client_lib.ApiClient.__new__(k8s_client_lib.ApiClient)
1782-
return shallow_client.sanitize_for_serialization(obj)
1781+
client = k8s_client_lib.ApiClient()
1782+
return client.sanitize_for_serialization(obj)
17831783

17841784

17851785
def _kubernetes_deserialize(obj_dict: dict[str, Any], cls: typing.Type[_T]) -> _T:
1786-
shallow_client = k8s_client_lib.ApiClient.__new__(k8s_client_lib.ApiClient)
1787-
return shallow_client._ApiClient__deserialize(obj_dict, cls)
1786+
client = k8s_client_lib.ApiClient()
1787+
return client._ApiClient__deserialize(obj_dict, cls)
17881788

17891789

17901790
def _update_dict_recursively(d1: dict, d2: dict):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies = [
99
"bugsnag>=4.9.0,<5",
1010
"cloud-pipelines>=0.23.2.4",
1111
"fastapi[standard]>=0.115.12",
12-
"kubernetes>=33.1.0,<36",
12+
"kubernetes>=36.0.0,<37",
1313
"opentelemetry-api>=1.41.1",
1414
"opentelemetry-exporter-otlp-proto-grpc>=1.41.1",
1515
"opentelemetry-exporter-otlp-proto-http>=1.39.1",

uv.lock

Lines changed: 10 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)