Skip to content

Commit 6d4a503

Browse files
committed
fix applying patch
1 parent 5fa277c commit 6d4a503

File tree

1,457 files changed

+894
-97723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,457 files changed

+894
-97723
lines changed

kubernetes_asyncio/client/api_client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async def __call_api(
165165
post_params.extend(self.files_parameters(files))
166166

167167
# auth setting
168-
self.update_params_for_auth(
168+
await self.update_params_for_auth(
169169
header_params, query_params, auth_settings,
170170
request_auth=_request_auth)
171171

@@ -198,7 +198,9 @@ async def __call_api(
198198
if not _preload_content:
199199
return return_data
200200

201-
response_type = response_types_map.get(response_data.status, None)
201+
response_type = None
202+
if response_types_map:
203+
response_type = response_types_map.get(response_data.status, None)
202204

203205
if six.PY3 and response_type not in ["file", "bytes"]:
204206
match = None
@@ -548,7 +550,7 @@ def select_header_content_type(self, content_types, method=None, body=None):
548550
else:
549551
return content_types[0]
550552

551-
def update_params_for_auth(self, headers, queries, auth_settings,
553+
async def update_params_for_auth(self, headers, queries, auth_settings,
552554
request_auth=None):
553555
"""Updates header and query params based on authentication setting.
554556
@@ -566,7 +568,7 @@ def update_params_for_auth(self, headers, queries, auth_settings,
566568
return
567569

568570
for auth in auth_settings:
569-
auth_setting = self.configuration.auth_settings().get(auth)
571+
auth_setting = (await self.configuration.auth_settings()).get(auth)
570572
if auth_setting:
571573
self._apply_auth_params(headers, queries, auth_setting)
572574

kubernetes_asyncio/client/configuration.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from __future__ import absolute_import
1414

15+
import asyncio
1516
import copy
1617
import logging
1718
import sys
@@ -177,6 +178,14 @@ def __init__(self, host=None,
177178
Set this to false to skip verifying SSL certificate when calling API
178179
from https server.
179180
"""
181+
self.disable_strict_ssl_verification = False
182+
"""Set to true, to accept certificates violate X509 strict certificate
183+
verification requirements, like missing the following extensions:
184+
- X509v3 Subject Key Identifier
185+
- X509v3 Authority Key Identifier
186+
- X509v3 Subject Alternative Name
187+
(It is implemented by removing ssl.VERIFY_X509_STRICT from SSLContext.verify_flags)
188+
"""
180189
self.ssl_ca_cert = ssl_ca_cert
181190
"""Set this to customize the certificate file to verify the peer.
182191
"""
@@ -189,6 +198,10 @@ def __init__(self, host=None,
189198
self.assert_hostname = None
190199
"""Set this to True/False to enable/disable SSL hostname verification.
191200
"""
201+
self.tls_server_name = None
202+
"""SSL/TLS Server Name Indication (SNI)
203+
Set this to the SNI value expected by Kubernetes API.
204+
"""
192205

193206
self.connection_pool_maxsize = 100
194207
"""This value is passed to the aiohttp to limit simultaneous connections.
@@ -249,6 +262,16 @@ def set_default(cls, default):
249262
"""
250263
cls._default = copy.deepcopy(default)
251264

265+
@classmethod
266+
def get_default(cls):
267+
"""Get default instance of configuration.
268+
269+
:return: The Configuration object.
270+
"""
271+
if cls._default is None:
272+
cls.set_default(Configuration())
273+
return cls._default
274+
252275
@classmethod
253276
def get_default_copy(cls):
254277
"""Return new instance of configuration.
@@ -348,15 +371,17 @@ def logger_format(self, value):
348371
self.__logger_format = value
349372
self.logger_formatter = logging.Formatter(self.__logger_format)
350373

351-
def get_api_key_with_prefix(self, identifier, alias=None):
374+
async def get_api_key_with_prefix(self, identifier, alias=None):
352375
"""Gets API key (with prefix if set).
353376
354377
:param identifier: The identifier of apiKey.
355378
:param alias: The alternative identifier of apiKey.
356379
:return: The token for api key authentication.
357380
"""
358381
if self.refresh_api_key_hook is not None:
359-
self.refresh_api_key_hook(self)
382+
result = self.refresh_api_key_hook(self)
383+
if asyncio.iscoroutine(result):
384+
await result
360385
key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
361386
if key:
362387
prefix = self.api_key_prefix.get(identifier)
@@ -380,7 +405,7 @@ def get_basic_auth_token(self):
380405
basic_auth=username + ':' + password
381406
).get('authorization')
382407

383-
def auth_settings(self):
408+
async def auth_settings(self):
384409
"""Gets Auth Settings dict for api client.
385410
386411
:return: The Auth Settings information dict.
@@ -391,7 +416,7 @@ def auth_settings(self):
391416
'type': 'api_key',
392417
'in': 'header',
393418
'key': 'authorization',
394-
'value': self.get_api_key_with_prefix(
419+
'value': await self.get_api_key_with_prefix(
395420
'BearerToken',
396421
),
397422
}

kubernetes_asyncio/client/configuration.py.orig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
77

8-
The version of the OpenAPI document: v1.32.3
8+
The version of the OpenAPI document: v1.33.3
99
Generated by: https://openapi-generator.tech
1010
"""
1111

@@ -417,8 +417,8 @@ conf = client.Configuration(
417417
return "Python SDK Debug Report:\n"\
418418
"OS: {env}\n"\
419419
"Python Version: {pyversion}\n"\
420-
"Version of the API: v1.32.3\n"\
421-
"SDK Package Version: 32.3.0+snapshot".\
420+
"Version of the API: v1.33.3\n"\
421+
"SDK Package Version: 33.3.0+snapshot".\
422422
format(env=sys.platform, pyversion=sys.version)
423423

424424
def get_host_settings(self):

kubernetes_asyncio/client/models/admissionregistration_v1_service_reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class AdmissionregistrationV1ServiceReference(object):
5252
def __init__(self, name=None, namespace=None, path=None, port=None, local_vars_configuration=None): # noqa: E501
5353
"""AdmissionregistrationV1ServiceReference - a model defined in OpenAPI""" # noqa: E501
5454
if local_vars_configuration is None:
55-
local_vars_configuration = Configuration.get_default_copy()
55+
local_vars_configuration = Configuration.get_default()
5656
self.local_vars_configuration = local_vars_configuration
5757

5858
self._name = None

kubernetes_asyncio/client/models/admissionregistration_v1_webhook_client_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class AdmissionregistrationV1WebhookClientConfig(object):
5050
def __init__(self, ca_bundle=None, service=None, url=None, local_vars_configuration=None): # noqa: E501
5151
"""AdmissionregistrationV1WebhookClientConfig - a model defined in OpenAPI""" # noqa: E501
5252
if local_vars_configuration is None:
53-
local_vars_configuration = Configuration.get_default_copy()
53+
local_vars_configuration = Configuration.get_default()
5454
self.local_vars_configuration = local_vars_configuration
5555

5656
self._ca_bundle = None

kubernetes_asyncio/client/models/apiextensions_v1_service_reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ApiextensionsV1ServiceReference(object):
5252
def __init__(self, name=None, namespace=None, path=None, port=None, local_vars_configuration=None): # noqa: E501
5353
"""ApiextensionsV1ServiceReference - a model defined in OpenAPI""" # noqa: E501
5454
if local_vars_configuration is None:
55-
local_vars_configuration = Configuration.get_default_copy()
55+
local_vars_configuration = Configuration.get_default()
5656
self.local_vars_configuration = local_vars_configuration
5757

5858
self._name = None

kubernetes_asyncio/client/models/apiextensions_v1_webhook_client_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class ApiextensionsV1WebhookClientConfig(object):
5050
def __init__(self, ca_bundle=None, service=None, url=None, local_vars_configuration=None): # noqa: E501
5151
"""ApiextensionsV1WebhookClientConfig - a model defined in OpenAPI""" # noqa: E501
5252
if local_vars_configuration is None:
53-
local_vars_configuration = Configuration.get_default_copy()
53+
local_vars_configuration = Configuration.get_default()
5454
self.local_vars_configuration = local_vars_configuration
5555

5656
self._ca_bundle = None

kubernetes_asyncio/client/models/apiregistration_v1_service_reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class ApiregistrationV1ServiceReference(object):
5050
def __init__(self, name=None, namespace=None, port=None, local_vars_configuration=None): # noqa: E501
5151
"""ApiregistrationV1ServiceReference - a model defined in OpenAPI""" # noqa: E501
5252
if local_vars_configuration is None:
53-
local_vars_configuration = Configuration.get_default_copy()
53+
local_vars_configuration = Configuration.get_default()
5454
self.local_vars_configuration = local_vars_configuration
5555

5656
self._name = None

kubernetes_asyncio/client/models/authentication_v1_token_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class AuthenticationV1TokenRequest(object):
5454
def __init__(self, api_version=None, kind=None, metadata=None, spec=None, status=None, local_vars_configuration=None): # noqa: E501
5555
"""AuthenticationV1TokenRequest - a model defined in OpenAPI""" # noqa: E501
5656
if local_vars_configuration is None:
57-
local_vars_configuration = Configuration.get_default_copy()
57+
local_vars_configuration = Configuration.get_default()
5858
self.local_vars_configuration = local_vars_configuration
5959

6060
self._api_version = None

kubernetes_asyncio/client/models/core_v1_endpoint_port.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class CoreV1EndpointPort(object):
5252
def __init__(self, app_protocol=None, name=None, port=None, protocol=None, local_vars_configuration=None): # noqa: E501
5353
"""CoreV1EndpointPort - a model defined in OpenAPI""" # noqa: E501
5454
if local_vars_configuration is None:
55-
local_vars_configuration = Configuration.get_default_copy()
55+
local_vars_configuration = Configuration.get_default()
5656
self.local_vars_configuration = local_vars_configuration
5757

5858
self._app_protocol = None

0 commit comments

Comments
 (0)