Skip to content

Commit

Permalink
Don't delete all nodes when empty string is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
herlo committed Mar 15, 2024
1 parent 851dc2a commit 124e73b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scripts/core_v1_api.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/kubernetes/client/api/core_v1_api.py b/kubernetes/client/api/core_v1_api.py
index 282d9b88..8de09a11 100644
--- a/kubernetes/client/api/core_v1_api.py
+++ b/kubernetes/client/api/core_v1_api.py
@@ -13680,7 +13680,10 @@ class CoreV1Api(object):
del local_var_params['kwargs']
# verify the required parameter 'name' is set
if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501
- local_var_params['name'] is None): # noqa: E501
+ local_var_params['name'] is None or # noqa: E501
+ not len(local_var_params['name'].strip())): # noqa: E501
+ raise ApiValueError("Missing the required parameter `name` when calling `delete_node`") # noqa: E501
+ if not len(name):
raise ApiValueError("Missing the required parameter `name` when calling `delete_node`") # noqa: E501

collection_formats = {}
2 changes: 2 additions & 0 deletions scripts/update-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ git apply "${SCRIPT_ROOT}/rest_client_patch.diff"
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"
# Delete Node fix for empty string
git apply "${SCRIPT_ROOT}/core_v1_api.diff"

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

0 comments on commit 124e73b

Please sign in to comment.