Kaydet (Commit) 66e7af93 authored tarafından Justin Michalicek's avatar Justin Michalicek

Pass X-Registry-Auth when building an image

* Initialize headers variable in BuildApiMixin.build() as a dict rather
  than as None.  This way the correct object gets passed to
  _set_auth_headers() even if no headers were set in build()

* Changing object from None to {} in BuildApiMixin._set_auth_headers()
  removed because it changes the object reference, so has no effect on
  calling code.
Signed-off-by: 's avatarJustin Michalicek <jmichalicek@gmail.com>
üst 5e47026a
......@@ -18,7 +18,8 @@ class BuildApiMixin(object):
custom_context=False, encoding=None, pull=False,
forcerm=False, dockerfile=None, container_limits=None,
decode=False, buildargs=None, gzip=False):
remote = context = headers = None
remote = context = None
headers = {}
container_limits = container_limits or {}
if path is None and fileobj is None:
raise TypeError("Either path or fileobj needs to be provided.")
......@@ -134,8 +135,7 @@ class BuildApiMixin(object):
', '.join(repr(k) for k in self._auth_configs.keys())
)
)
if headers is None:
headers = {}
if utils.compare_version('1.19', self._version) >= 0:
headers['X-Registry-Config'] = auth.encode_header(
self._auth_configs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment