diff --git a/README.md b/README.md index e0daf567..0a70968d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Documentation [![Documentation Status](https://readthedocs.org/projects/docker-py/badge/?version=latest)](https://readthedocs.org/projects/docker-py/?badge=latest) -[Read the full documentation here.](http://docker-py.readthedocs.org/en/latest/). +[Read the full documentation here](http://docker-py.readthedocs.org/en/latest/). The source is available in the `docs/` directory. diff --git a/docker/auth/auth.py b/docker/auth/auth.py index eedb7944..d23e6f3c 100644 --- a/docker/auth/auth.py +++ b/docker/auth/auth.py @@ -117,7 +117,7 @@ def parse_auth(entries, raise_on_error=False): conf = {} for registry, entry in six.iteritems(entries): - if not (isinstance(entry, dict) and 'auth' in entry): + if not isinstance(entry, dict): log.debug( 'Config entry for key {0} is not auth config'.format(registry) ) @@ -130,6 +130,16 @@ def parse_auth(entries, raise_on_error=False): 'Invalid configuration for registry {0}'.format(registry) ) return {} + if 'auth' not in entry: + # Starting with engine v1.11 (API 1.23), an empty dictionary is + # a valid value in the auths config. + # https://github.com/docker/compose/issues/3265 + log.debug( + 'Auth data for {0} is absent. Client might be using a ' + 'credentials store instead.' + ) + return {} + username, password = decode_auth(entry['auth']) log.debug( 'Found entry (registry={0}, username={1})' @@ -189,6 +199,9 @@ def load_config(config_path=None): if data.get('HttpHeaders'): log.debug("Found 'HttpHeaders' section") res.update({'HttpHeaders': data['HttpHeaders']}) + if data.get('credsStore'): + log.debug("Found 'credsStore' section") + res.update({'credsStore': data['credsStore']}) if res: return res else: diff --git a/docker/version.py b/docker/version.py index d53b6f4e..72cd0e06 100644 --- a/docker/version.py +++ b/docker/version.py @@ -1,2 +1,2 @@ -version = "1.8.0-rc4" +version = "1.8.0" version_info = tuple([int(d) for d in version.split("-")[0].split(".")]) diff --git a/docs/change_log.md b/docs/change_log.md index fc37ba01..f8913797 100644 --- a/docs/change_log.md +++ b/docs/change_log.md @@ -27,16 +27,19 @@ Change Log ### Bugfixes -* Fixed a bug where some environment variables specified through - `create_container` would be improperly formatted +* Fixed a bug where TLS verification would fail when using IP addresses + in the certificate's `subjectAltName` fields * Fixed an issue where the default TLS version in TLSConfig would break in some environments. `docker-py` now uses TLSv1 by default This setting can be overridden using the `ssl_version` param in `kwargs_from_env` or the `TLSConfig` constructor +* Fixed a bug where `tcp` hosts would fail to connect to TLS-enabled + endpoints +* Fixed a bug where loading a valid docker configuration file would fail +* Fixed a bug where some environment variables specified through + `create_container` would be improperly formatted * Fixed a bug where using the unix socket connection would raise an error in some edge-case situations -* Fixed a bug where `tcp` hosts would fail to connect to TLS-enabled - endpoints. ### Miscellaneous diff --git a/setup.py b/setup.py index 44cd164a..0329ba3d 100644 --- a/setup.py +++ b/setup.py @@ -12,8 +12,9 @@ requirements = [ 'websocket-client >= 0.32.0', ] -if sys.version_info[0] == 2: - requirements.append('py2-ipaddress >= 3.4.1') +extras_require = { + ':python_version < "3"': 'py2-ipaddress >= 3.4.1', +} exec(open('docker/version.py').read()) @@ -32,6 +33,7 @@ setup( ], install_requires=requirements, tests_require=test_requirements, + extras_require=extras_require, zip_safe=False, test_suite='tests', classifiers=[ diff --git a/tests/unit/auth_test.py b/tests/unit/auth_test.py index 921aae00..4ea40477 100644 --- a/tests/unit/auth_test.py +++ b/tests/unit/auth_test.py @@ -459,6 +459,5 @@ class LoadConfigTest(base.Cleanup, base.BaseTestCase): with open(dockercfg_path, 'w') as f: json.dump(config, f) - self.assertRaises( - errors.InvalidConfigFile, auth.load_config, dockercfg_path - ) + cfg = auth.load_config(dockercfg_path) + assert cfg == {}