Apply hotfixes

Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>
This commit is contained in:
Nabarun Pal 2021-05-27 18:34:53 +05:30
parent c55930bb50
commit 4fd43bc909
No known key found for this signature in database
GPG Key ID: 611D5079D826B150
3 changed files with 44 additions and 6 deletions

View File

@ -2425,7 +2425,7 @@ class CustomObjectsApi(object):
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json-patch+json', 'application/merge-patch+json']) # noqa: E501
['application/merge-patch+json']) # noqa: E501
# Authentication setting
auth_settings = ['BearerToken'] # noqa: E501
@ -2594,7 +2594,7 @@ class CustomObjectsApi(object):
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json-patch+json', 'application/merge-patch+json']) # noqa: E501
['application/merge-patch+json']) # noqa: E501
# Authentication setting
auth_settings = ['BearerToken'] # noqa: E501
@ -2763,7 +2763,7 @@ class CustomObjectsApi(object):
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json-patch+json', 'application/merge-patch+json']) # noqa: E501
['application/merge-patch+json']) # noqa: E501
# Authentication setting
auth_settings = ['BearerToken'] # noqa: E501
@ -2941,7 +2941,7 @@ class CustomObjectsApi(object):
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json-patch+json', 'application/merge-patch+json']) # noqa: E501
['application/merge-patch+json']) # noqa: E501
# Authentication setting
auth_settings = ['BearerToken'] # noqa: E501
@ -3119,7 +3119,7 @@ class CustomObjectsApi(object):
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json-patch+json', 'application/merge-patch+json', 'application/apply-patch+yaml']) # noqa: E501
['application/merge-patch+json']) # noqa: E501
# Authentication setting
auth_settings = ['BearerToken'] # noqa: E501
@ -3297,7 +3297,7 @@ class CustomObjectsApi(object):
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json-patch+json', 'application/merge-patch+json', 'application/apply-patch+yaml']) # noqa: E501
['application/merge-patch+json']) # noqa: E501
# Authentication setting
auth_settings = ['BearerToken'] # noqa: E501

View File

@ -0,0 +1,13 @@
from __future__ import absolute_import
import warnings
# flake8: noqa
# alias kubernetes.client.api package and print deprecation warning
from kubernetes.client.api import *
warnings.filterwarnings('default', module='kubernetes.client.apis')
warnings.warn(
"The package kubernetes.client.apis is renamed and deprecated, use kubernetes.client.api instead (please note that the trailing s was removed).",
DeprecationWarning
)

View File

@ -0,0 +1,25 @@
# coding: utf-8
import atexit
import weakref
import unittest
import kubernetes
class TestApiClient(unittest.TestCase):
def test_context_manager_closes_threadpool(self):
with kubernetes.client.ApiClient() as client:
self.assertIsNotNone(client.pool)
pool_ref = weakref.ref(client._pool)
self.assertIsNotNone(pool_ref())
self.assertIsNone(pool_ref())
def test_atexit_closes_threadpool(self):
client = kubernetes.client.ApiClient()
self.assertIsNotNone(client.pool)
self.assertIsNotNone(client._pool)
atexit._run_exitfuncs()
self.assertIsNone(client._pool)