Skip to content

Commit

Permalink
generated client change
Browse files Browse the repository at this point in the history
  • Loading branch information
roycaihw committed Oct 25, 2021
1 parent 00d1e5b commit 068a541
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 39 deletions.
2 changes: 1 addition & 1 deletion kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
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):
Expand Down
5 changes: 1 addition & 4 deletions kubernetes/client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ def __init__(self, host="http://localhost",
self.proxy = None
"""Proxy URL
"""
self.no_proxy = None
"""bypass proxy for host in the no_proxy list.
"""
self.proxy_headers = None
"""Proxy headers
"""
Expand Down Expand Up @@ -350,7 +347,7 @@ def to_debug_report(self):
"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):
Expand Down
3 changes: 1 addition & 2 deletions kubernetes/client/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import urllib3

from kubernetes.client.exceptions import ApiException, ApiValueError
from requests.utils import should_bypass_proxies


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -84,7 +83,7 @@ def __init__(self, configuration, pools_size=4, maxsize=None):
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,
Expand Down
28 changes: 1 addition & 27 deletions kubernetes/test/test_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
import unittest

import kubernetes
from kubernetes.client.configuration import Configuration
import urllib3


class TestApiClient(unittest.TestCase):

Expand All @@ -24,28 +23,3 @@ def test_atexit_closes_threadpool(self):
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 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

# 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
#
Expand Down

0 comments on commit 068a541

Please sign in to comment.