Merge pull request #682 from docker/moutten-fix-build-auth

Switch to send full AuthConfig object for build action
This commit is contained in:
Joffrey F 2015-07-22 11:11:21 -07:00
commit f8ad2dabf2
2 changed files with 8 additions and 9 deletions

View File

@ -98,12 +98,6 @@ def encode_header(auth):
return base64.b64encode(auth_json)
def encode_full_header(auth):
""" Returns the given auth block encoded for the X-Registry-Config header.
"""
return encode_header({'configs': auth})
def parse_auth(entries):
"""
Parses authentication entries

View File

@ -140,9 +140,14 @@ class Client(clientbase.ClientBase):
if self._auth_configs:
if headers is None:
headers = {}
headers['X-Registry-Config'] = auth.encode_full_header(
self._auth_configs
)
if utils.compare_version('1.19', self._version) >= 0:
headers['X-Registry-Config'] = auth.encode_header(
self._auth_configs
)
else:
headers['X-Registry-Config'] = auth.encode_header({
'configs': self._auth_configs
})
response = self._post(
u,