File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -90,9 +90,12 @@ def resolve_authconfig(authconfig, registry=None):
90
90
log .debug (
91
91
'Using credentials store "{0}"' .format (store_name )
92
92
)
93
- return _resolve_authconfig_credstore (
93
+ cfg = _resolve_authconfig_credstore (
94
94
authconfig , registry , store_name
95
95
)
96
+ if cfg is not None :
97
+ return cfg
98
+ log .debug ('No entry in credstore - fetching from auth dict' )
96
99
97
100
# Default to the public index server
98
101
registry = resolve_index_name (registry ) if registry else INDEX_NAME
Original file line number Diff line number Diff line change @@ -210,6 +210,19 @@ def test_resolve_registry_and_auth_unauthenticated_registry(self):
210
210
self .auth_config , auth .resolve_repository_name (image )[0 ]
211
211
) is None
212
212
213
+ def test_resolve_auth_with_empty_credstore_and_auth_dict (self ):
214
+ auth_config = {
215
+ 'auths' : auth .parse_auth ({
216
+ 'https://index.docker.io/v1/' : self .index_config ,
217
+ }),
218
+ 'credsStore' : 'blackbox'
219
+ }
220
+ with mock .patch ('docker.auth._resolve_authconfig_credstore' ) as m :
221
+ m .return_value = None
222
+ assert 'indexuser' == auth .resolve_authconfig (
223
+ auth_config , None
224
+ )['username' ]
225
+
213
226
214
227
class CredStoreTest (unittest .TestCase ):
215
228
def test_get_credential_store (self ):
You can’t perform that action at this time.
0 commit comments