Skip to content

Commit df43d15

Browse files
authored
Merge pull request kubernetes-client#2175 from arcivanov/issue_2169
Provides a patch to stop using urllib3 deprecated APIs until the upgrade to latest OpenAPI Generator (>6.4.0)
2 parents f6fe74a + 647d5d1 commit df43d15

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

scripts/rest_urllib_headers.diff

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/kubernetes/client/exceptions.py b/kubernetes/client/exceptions.py
2+
index c7c152b5..1e23d80a 100644
3+
--- a/kubernetes/client/exceptions.py
4+
+++ b/kubernetes/client/exceptions.py
5+
@@ -88,7 +88,7 @@ class ApiException(OpenApiException):
6+
self.status = http_resp.status
7+
self.reason = http_resp.reason
8+
self.body = http_resp.data
9+
- self.headers = http_resp.getheaders()
10+
+ self.headers = http_resp.headers
11+
else:
12+
self.status = status
13+
self.reason = reason

scripts/update-client.sh

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ git apply "${SCRIPT_ROOT}/rest_client_patch.diff"
7878
# once we upgrade to a version of swagger-codegen that includes it (version>= 6.6.0).
7979
# See https://github.com/OpenAPITools/openapi-generator/pull/15283
8080
git apply "${SCRIPT_ROOT}/rest_sni_patch.diff"
81+
# OpenAPI client generator prior to 6.4.0 uses deprecated urllib3 APIs.
82+
git apply "${SCRIPT_ROOT}/rest_urllib_headers.diff"
8183

8284
echo ">>> generating docs..."
8385
pushd "${DOC_ROOT}" > /dev/null

0 commit comments

Comments
 (0)