diff options
author | Joffrey F <joffrey@docker.com> | 2018-06-08 15:14:06 -0700 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2018-06-08 15:24:56 -0700 |
commit | 9d8ea53149b21ff64d1fa5911eecb54ff3dc2244 (patch) | |
tree | a25cc3cbe4dd35da5131b522846c0d8cbfe25246 /docker/api/client.py | |
parent | 2d0c5dd484e7621a9859ab40ac43d25a1f5f5078 (diff) | |
download | docker-py-c5930-credstore-env.tar.gz |
Allow passing of env overrides to credstore through APIClient ctorc5930-credstore-env
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker/api/client.py')
-rw-r--r-- | docker/api/client.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/docker/api/client.py b/docker/api/client.py index 13c292a..91da1c8 100644 --- a/docker/api/client.py +++ b/docker/api/client.py @@ -83,6 +83,8 @@ class APIClient( :py:class:`~docker.tls.TLSConfig` object to use custom configuration. user_agent (str): Set a custom user agent for requests to the server. + credstore_env (dict): Override environment variables when calling the + credential store process. """ __attrs__ = requests.Session.__attrs__ + ['_auth_configs', @@ -93,7 +95,8 @@ class APIClient( def __init__(self, base_url=None, version=None, timeout=DEFAULT_TIMEOUT_SECONDS, tls=False, - user_agent=DEFAULT_USER_AGENT, num_pools=DEFAULT_NUM_POOLS): + user_agent=DEFAULT_USER_AGENT, num_pools=DEFAULT_NUM_POOLS, + credstore_env=None): super(APIClient, self).__init__() if tls and not base_url: @@ -109,6 +112,7 @@ class APIClient( self._auth_configs = auth.load_config( config_dict=self._general_configs ) + self.credstore_env = credstore_env base_url = utils.parse_host( base_url, IS_WINDOWS_PLATFORM, tls=bool(tls) |