Merge pull request #37863 from rallytime/bp-36893

Back-port #36893 to 2016.3
This commit is contained in:
Nicole Thomas 2016-11-23 10:09:09 -07:00 committed by GitHub
commit d0cc7f0d56

View File

@ -55,6 +55,7 @@ be used, it is recommended to place this configuration in :ref:`Pillar
email: <email_address> email: <email_address>
password: <password> password: <password>
username: <username> username: <username>
reauth: <boolean>
For example: For example:
@ -66,6 +67,22 @@ For example:
password: s3cr3t password: s3cr3t
username: foo username: foo
Reauth is an optional parameter that forces the docker login to reauthorize using
the credentials passed in the pillar data. Defaults to false.
.. versionadded:: 2016.3.5,2016.11.1
For example:
.. code-block:: yaml
docker-registries:
https://index.docker.io/v1/:
email: foo@foo.com
password: s3cr3t
username: foo
reauth: True
Mulitiple registries can be configured. This can be done in one of two ways. Mulitiple registries can be configured. This can be done in one of two ways.
The first way is to configure each registry under the ``docker-registries`` The first way is to configure each registry under the ``docker-registries``
pillar key. pillar key.
@ -953,7 +970,8 @@ def _image_wrapper(attr, *args, **kwargs):
creds['username'], creds['username'],
password=creds['password'], password=creds['password'],
email=creds.get('email'), email=creds.get('email'),
registry=registry) registry=registry,
reauth=creds.get('reauth', False))
except KeyError: except KeyError:
raise SaltInvocationError( raise SaltInvocationError(
err.format('Incomplete', ' for registry {0}'.format(registry)) err.format('Incomplete', ' for registry {0}'.format(registry))