Skip to content

Commit

Permalink
Provides a patch to stop using urllib3 deprecated APIs until the upgr…
Browse files Browse the repository at this point in the history
…ade to latest OpenAPI Generator (>6.4.0)
  • Loading branch information
arcivanov committed Jan 2, 2024
1 parent ecdbed0 commit 8caf8da
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Unreleased

### Bug or Regression
- Provides a patch to stop using urllib3 deprecated APIs until the upgrade to latest OpenAPI Generator (>6.4.0)

# v29.0.0b1

Kubernetes API Version: v1.29.0
Expand Down
13 changes: 13 additions & 0 deletions scripts/rest_urllib_headers.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/kubernetes/client/exceptions.py b/kubernetes/client/exceptions.py
index c7c152b5..1e23d80a 100644
--- a/kubernetes/client/exceptions.py
+++ b/kubernetes/client/exceptions.py
@@ -88,7 +88,7 @@ class ApiException(OpenApiException):
self.status = http_resp.status
self.reason = http_resp.reason
self.body = http_resp.data
- self.headers = http_resp.getheaders()
+ self.headers = http_resp.headers
else:
self.status = status
self.reason = reason
2 changes: 2 additions & 0 deletions scripts/update-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ git apply "${SCRIPT_ROOT}/rest_client_patch.diff"
# once we upgrade to a version of swagger-codegen that includes it (version>= 6.6.0).
# See https://github.com/OpenAPITools/openapi-generator/pull/15283
git apply "${SCRIPT_ROOT}/rest_sni_patch.diff"
# OpenAPI client generator prior to 6.4.0 uses deprecated urllib3 APIs.
git apply "${SCRIPT_ROOT}/rest_urllib_headers.diff"

echo ">>> generating docs..."
pushd "${DOC_ROOT}" > /dev/null
Expand Down

0 comments on commit 8caf8da

Please sign in to comment.