Skip to content

Commit

Permalink
Merge pull request kubernetes-client#714 from roycaihw/release-9.0.0a1
Browse files Browse the repository at this point in the history
Release 9.0.0a1: update version constant
  • Loading branch information
k8s-ci-robot authored Dec 28, 2018
2 parents 30c3522 + 1ccb5a3 commit 4d32e73
Show file tree
Hide file tree
Showing 1,279 changed files with 1,931 additions and 1,287 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# v9.0.0a1
**New Feature:**
- Avoid creating unused ThreadPools [kubernetes-client/gen#91](https://github.com/kubernetes-client/gen/pull/91)

**Bug Fix:**
- Refresh GCP auth tokens on API retrieval [kubernetes-client/python-base#92](https://github.com/kubernetes-client/python-base/pull/92)
- Fix kubeconfig loading failure when server uri contains trailing slash [kubernetes-client/python-base#45](https://github.com/kubernetes-client/python-base/pull/45)
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ No description provided (generated by Swagger Codegen https://github.com/swagger

This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: v1.13.1
- Package version: 9.0.0-snapshot
- API version: v1.13.2
- Package version: 9.0.0a1
- Build package: io.swagger.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__ = "9.0.0-snapshot"
__version__ = "9.0.0a1"

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 @@ -5,7 +5,7 @@
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.1
OpenAPI spec version: v1.13.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
25 changes: 19 additions & 6 deletions kubernetes/client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.1
OpenAPI spec version: v1.13.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down Expand Up @@ -58,24 +58,37 @@ class ApiClient(object):
'datetime': datetime,
'object': object,
}
_pool = None

def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None):
def __init__(self, configuration=None, header_name=None, header_value=None,
cookie=None, pool_threads=None):
if configuration is None:
configuration = Configuration()
self.configuration = configuration
self.pool_threads = pool_threads

self.pool = ThreadPool()
self.rest_client = RESTClientObject(configuration)
self.default_headers = {}
if header_name is not None:
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'Swagger-Codegen/9.0.0-snapshot/python'
self.user_agent = 'Swagger-Codegen/9.0.0a1/python'

def __del__(self):
self.pool.close()
self.pool.join()
if self._pool:
self._pool.close()
self._pool.join()
self._pool = None

@property
def pool(self):
"""Create thread pool on first request
avoids instantiating unused threadpool for blocking clients.
"""
if self._pool is None:
self._pool = ThreadPool(self.pool_threads)
return self._pool

@property
def user_agent(self):
Expand Down
Loading

0 comments on commit 4d32e73

Please sign in to comment.