Skip to content

Commit 35b8c0a

Browse files
authored
Merge pull request #1586 from terminalmage/refresh_credentials
Add function to refresh credentials from config.json
2 parents 0872f27 + 550c31e commit 35b8c0a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docker/api/client.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,3 +433,17 @@ def get_adapter(self, url):
433433
@property
434434
def api_version(self):
435435
return self._version
436+
437+
def reload_config(self, dockercfg_path=None):
438+
"""
439+
Force a reload of the auth configuration
440+
441+
Args:
442+
dockercfg_path (str): Use a custom path for the Docker config file
443+
(default ``$HOME/.docker/config.json`` if present,
444+
otherwise``$HOME/.dockercfg``)
445+
446+
Returns:
447+
None
448+
"""
449+
self._auth_configs = auth.load_config(dockercfg_path)

0 commit comments

Comments
 (0)