From bc84ed11ec7f7e20f27139a5e44ae0862d5a1f7b Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Fri, 30 Nov 2018 15:40:14 -0800 Subject: Fix empty authconfig detection Signed-off-by: Joffrey F --- docker/auth.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'docker/auth.py') diff --git a/docker/auth.py b/docker/auth.py index c1b874f..58b35eb 100644 --- a/docker/auth.py +++ b/docker/auth.py @@ -39,7 +39,7 @@ def resolve_index_name(index_name): def get_config_header(client, registry): log.debug('Looking for auth config') - if not client._auth_configs: + if not client._auth_configs or client._auth_configs.is_empty: log.debug( "No auth config in memory - loading from filesystem" ) @@ -212,6 +212,12 @@ class AuthConfig(dict): def cred_helpers(self): return self.get('credHelpers', {}) + @property + def is_empty(self): + return ( + not self.auths and not self.creds_store and not self.cred_helpers + ) + def resolve_authconfig(self, registry=None): """ Returns the authentication data from the given auth configuration for a -- cgit v1.2.1