generated client change
This commit is contained in:
parent
00d1e5b116
commit
068a541d88
@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena
|
||||
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||
|
||||
- API version: release-1.19
|
||||
- Package version: 19.15.0b1
|
||||
- Package version: 19.15.0
|
||||
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
|
||||
|
||||
## Requirements.
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
__project__ = 'kubernetes'
|
||||
# The version is auto-updated. Please do not edit.
|
||||
__version__ = "19.15.0b1"
|
||||
__version__ = "19.15.0"
|
||||
|
||||
import kubernetes.client
|
||||
import kubernetes.config
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
__version__ = "19.15.0b1"
|
||||
__version__ = "19.15.0"
|
||||
|
||||
# import apis into sdk package
|
||||
from kubernetes.client.api.admissionregistration_api import AdmissionregistrationApi
|
||||
|
||||
@ -78,7 +78,7 @@ class ApiClient(object):
|
||||
self.default_headers[header_name] = header_value
|
||||
self.cookie = cookie
|
||||
# Set default User-Agent.
|
||||
self.user_agent = 'OpenAPI-Generator/19.15.0b1/python'
|
||||
self.user_agent = 'OpenAPI-Generator/19.15.0/python'
|
||||
self.client_side_validation = configuration.client_side_validation
|
||||
|
||||
def __enter__(self):
|
||||
|
||||
@ -156,9 +156,6 @@ class Configuration(object):
|
||||
self.proxy = None
|
||||
"""Proxy URL
|
||||
"""
|
||||
self.no_proxy = None
|
||||
"""bypass proxy for host in the no_proxy list.
|
||||
"""
|
||||
self.proxy_headers = None
|
||||
"""Proxy headers
|
||||
"""
|
||||
@ -350,7 +347,7 @@ class Configuration(object):
|
||||
"OS: {env}\n"\
|
||||
"Python Version: {pyversion}\n"\
|
||||
"Version of the API: release-1.19\n"\
|
||||
"SDK Package Version: 19.15.0b1".\
|
||||
"SDK Package Version: 19.15.0".\
|
||||
format(env=sys.platform, pyversion=sys.version)
|
||||
|
||||
def get_host_settings(self):
|
||||
|
||||
@ -25,7 +25,6 @@ from six.moves.urllib.parse import urlencode
|
||||
import urllib3
|
||||
|
||||
from kubernetes.client.exceptions import ApiException, ApiValueError
|
||||
from requests.utils import should_bypass_proxies
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -84,7 +83,7 @@ class RESTClientObject(object):
|
||||
maxsize = 4
|
||||
|
||||
# https pool manager
|
||||
if configuration.proxy and not should_bypass_proxies(configuration.host, no_proxy=configuration.no_proxy or ''):
|
||||
if configuration.proxy:
|
||||
self.pool_manager = urllib3.ProxyManager(
|
||||
num_pools=pools_size,
|
||||
maxsize=maxsize,
|
||||
|
||||
@ -6,8 +6,7 @@ import weakref
|
||||
import unittest
|
||||
|
||||
import kubernetes
|
||||
from kubernetes.client.configuration import Configuration
|
||||
import urllib3
|
||||
|
||||
|
||||
class TestApiClient(unittest.TestCase):
|
||||
|
||||
@ -24,28 +23,3 @@ class TestApiClient(unittest.TestCase):
|
||||
self.assertIsNotNone(client._pool)
|
||||
atexit._run_exitfuncs()
|
||||
self.assertIsNone(client._pool)
|
||||
|
||||
def test_rest_proxycare(self):
|
||||
|
||||
pool = { 'proxy': urllib3.ProxyManager, 'direct': urllib3.PoolManager }
|
||||
|
||||
for dst, proxy, no_proxy, expected_pool in [
|
||||
( 'http://kube.local/', None, None, pool['direct']),
|
||||
( 'http://kube.local/', 'http://proxy.local:8080/', None, pool['proxy']),
|
||||
( 'http://127.0.0.1:8080/', 'http://proxy.local:8080/', 'localhost,127.0.0.0/8,.local', pool['direct']),
|
||||
( 'http://kube.local/', 'http://proxy.local:8080/', 'localhost,127.0.0.0/8,.local', pool['direct']),
|
||||
( 'http://kube.others.com:1234/','http://proxy.local:8080/', 'localhost,127.0.0.0/8,.local', pool['proxy']),
|
||||
( 'http://kube.others.com:1234/','http://proxy.local:8080/', '*', pool['direct']),
|
||||
]:
|
||||
# setup input
|
||||
config = Configuration()
|
||||
setattr(config, 'host', dst)
|
||||
if proxy is not None:
|
||||
setattr(config, 'proxy', proxy)
|
||||
if no_proxy is not None:
|
||||
setattr(config, 'no_proxy', no_proxy)
|
||||
# setup done
|
||||
|
||||
# test
|
||||
client = kubernetes.client.ApiClient(configuration=config)
|
||||
self.assertEqual( expected_pool, type(client.rest_client.pool_manager) )
|
||||
|
||||
4
setup.py
4
setup.py
@ -16,9 +16,9 @@ from setuptools import setup
|
||||
|
||||
# Do not edit these constants. They will be updated automatically
|
||||
# by scripts/update-client.sh.
|
||||
CLIENT_VERSION = "19.15.0b1"
|
||||
CLIENT_VERSION = "19.15.0"
|
||||
PACKAGE_NAME = "kubernetes"
|
||||
DEVELOPMENT_STATUS = "4 - Beta"
|
||||
DEVELOPMENT_STATUS = "5 - Production/Stable"
|
||||
|
||||
# To install the library, run the following
|
||||
#
|
||||
|
||||
Loading…
Reference in New Issue
Block a user