From 4be228653df9028bef4a288148d392d7e9b0448a Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Mon, 20 Jul 2015 14:06:33 -0700 Subject: Make build auth work with API versions < 1.19 too --- docker/client.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docker/client.py b/docker/client.py index 7fe72db..41dd03a 100644 --- a/docker/client.py +++ b/docker/client.py @@ -140,9 +140,14 @@ class Client(clientbase.ClientBase): if self._auth_configs: if headers is None: headers = {} - headers['X-Registry-Config'] = auth.encode_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, -- cgit v1.2.1