Skip to content

Fix: Prevent unintended pod listing on empty 'name' parameter in "read_namespaced_pod". #2392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
19 changes: 11 additions & 8 deletions kubernetes/client/api/core_v1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24049,14 +24049,17 @@ def read_namespaced_pod_with_http_info(self, name, namespace, **kwargs): # noqa
)
local_var_params[key] = val
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
raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_pod`") # noqa: E501
# verify the required parameter 'namespace' is set
if self.api_client.client_side_validation and ('namespace' not in local_var_params or # noqa: E501
local_var_params['namespace'] is None): # noqa: E501
raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_pod`") # noqa: E501
# Verify the required parameter 'name' is set
if self.api_client.client_side_validation and ('name' not in local_var_params or local_var_params['name'] is None):
raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_pod`")

# Additional check to prevent empty string for 'name'
if self.api_client.client_side_validation and local_var_params.get('name') == "":
raise ApiValueError("Invalid value for parameter `name`: empty string is not allowed in read_namespaced_pod")

# Verify the required parameter 'namespace' is set
if self.api_client.client_side_validation and ('namespace' not in local_var_params or local_var_params['namespace'] is None):
raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_pod`")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is generated as seen at the beginning of this file. It should not be manually edited.

=======
The version of the OpenAPI document: release-1.32
Generated by: https://openapi-generator.tech

=======


collection_formats = {}

Expand Down