From ebcfab0a4c1430846de1b26a114570e4eb0d6a1a Mon Sep 17 00:00:00 2001 From: Matt Outten Date: Fri, 17 Jul 2015 15:48:52 -0400 Subject: [PATCH] Switch to send full AuthConfig object for build action In order to support the docker API for version 1.7+, this command changes the way the `X-Registry-Config` header is sent when attempting to build an image. --- docker/auth/auth.py | 6 ------ docker/client.py | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/docker/auth/auth.py b/docker/auth/auth.py index 1c29615546..d7fbd6b83f 100644 --- a/docker/auth/auth.py +++ b/docker/auth/auth.py @@ -102,12 +102,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 diff --git a/docker/client.py b/docker/client.py index e52cb53829..ce4a657139 100644 --- a/docker/client.py +++ b/docker/client.py @@ -139,7 +139,7 @@ def build(self, path=None, tag=None, quiet=False, fileobj=None, if self._auth_configs: if headers is None: headers = {} - headers['X-Registry-Config'] = auth.encode_full_header( + headers['X-Registry-Config'] = auth.encode_header( self._auth_configs )