Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion kubernetes_asyncio/client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ async def __call_api(
if not _preload_content:
return return_data

response_type = response_types_map.get(response_data.status, None)
response_type = None
if response_types_map:
response_type = response_types_map.get(response_data.status, None)

if six.PY3 and response_type not in ["file", "bytes"]:
match = None
Expand Down
15 changes: 15 additions & 0 deletions scripts/api_client_response_types_map_patch.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/kubernetes_asyncio/client/api_client.py b/kubernetes_asyncio/client/api_client.py
index 0d543478..2791a9cd 100644
--- a/kubernetes_asyncio/client/api_client.py
+++ b/kubernetes_asyncio/client/api_client.py
@@ -198,7 +198,9 @@ class ApiClient(object):
if not _preload_content:
return return_data

- response_type = response_types_map.get(response_data.status, None)
+ response_type = None
+ if response_types_map:
+ response_type = response_types_map.get(response_data.status, None)

if six.PY3 and response_type not in ["file", "bytes"]:
match = None
2 changes: 2 additions & 0 deletions scripts/update-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ sed -i'' "s,^DEVELOPMENT_STATUS = .*,DEVELOPMENT_STATUS = \\\"${DEVELOPMENT_STAT

echo ">>> fix generated api client for patching with strategic merge..."
patch "${CLIENT_ROOT}/client/api_client.py" "${SCRIPT_ROOT}/api_client_strategic_merge_patch.diff"
echo ">>> fix generated api client by adding 'none' check..."
patch "${CLIENT_ROOT}/client/api_client.py" "${SCRIPT_ROOT}/api_client_response_types_map.diff"
echo ">>> fix generated rest client by accepting application/apply-patch+yaml content type"
patch "${CLIENT_ROOT}/client/rest.py" "${SCRIPT_ROOT}/rest_client_apply_patch_patch.diff"
echo ">>> fix generated rest client by increasing aiohttp read buffer to 2MiB..."
Expand Down