mirror of https://github.com/docker/compose.git
commit
a9597d72f5
|
@ -1,6 +1,14 @@
|
|||
Change log
|
||||
==========
|
||||
|
||||
1.17.1 (2017-11-08)
|
||||
------------------
|
||||
|
||||
### Bugfixes
|
||||
|
||||
- Fixed a bug that would prevent creating new containers when using
|
||||
container labels in the list format as part of the service's definition.
|
||||
|
||||
1.17.0 (2017-11-02)
|
||||
-------------------
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
__version__ = '1.17.0'
|
||||
__version__ = '1.17.1'
|
||||
|
|
|
@ -706,14 +706,7 @@ def process_service(service_config):
|
|||
]
|
||||
|
||||
if 'build' in service_dict:
|
||||
if isinstance(service_dict['build'], six.string_types):
|
||||
service_dict['build'] = resolve_build_path(working_dir, service_dict['build'])
|
||||
elif isinstance(service_dict['build'], dict):
|
||||
if 'context' in service_dict['build']:
|
||||
path = service_dict['build']['context']
|
||||
service_dict['build']['context'] = resolve_build_path(working_dir, path)
|
||||
if 'labels' in service_dict['build']:
|
||||
service_dict['build']['labels'] = parse_labels(service_dict['build']['labels'])
|
||||
process_build_section(service_dict, working_dir)
|
||||
|
||||
if 'volumes' in service_dict and service_dict.get('volume_driver') is None:
|
||||
service_dict['volumes'] = resolve_volume_paths(working_dir, service_dict)
|
||||
|
@ -721,6 +714,9 @@ def process_service(service_config):
|
|||
if 'sysctls' in service_dict:
|
||||
service_dict['sysctls'] = build_string_dict(parse_sysctls(service_dict['sysctls']))
|
||||
|
||||
if 'labels' in service_dict:
|
||||
service_dict['labels'] = parse_labels(service_dict['labels'])
|
||||
|
||||
service_dict = process_depends_on(service_dict)
|
||||
|
||||
for field in ['dns', 'dns_search', 'tmpfs']:
|
||||
|
@ -734,6 +730,17 @@ def process_service(service_config):
|
|||
return service_dict
|
||||
|
||||
|
||||
def process_build_section(service_dict, working_dir):
|
||||
if isinstance(service_dict['build'], six.string_types):
|
||||
service_dict['build'] = resolve_build_path(working_dir, service_dict['build'])
|
||||
elif isinstance(service_dict['build'], dict):
|
||||
if 'context' in service_dict['build']:
|
||||
path = service_dict['build']['context']
|
||||
service_dict['build']['context'] = resolve_build_path(working_dir, path)
|
||||
if 'labels' in service_dict['build']:
|
||||
service_dict['build']['labels'] = parse_labels(service_dict['build']['labels'])
|
||||
|
||||
|
||||
def process_ports(service_dict):
|
||||
if 'ports' not in service_dict:
|
||||
return service_dict
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
VERSION="1.17.0"
|
||||
VERSION="1.17.1"
|
||||
IMAGE="docker/compose:$VERSION"
|
||||
|
||||
|
||||
|
|
|
@ -407,6 +407,32 @@ class ConfigTest(unittest.TestCase):
|
|||
}
|
||||
}
|
||||
|
||||
def test_load_config_service_labels(self):
|
||||
base_file = config.ConfigFile(
|
||||
'base.yaml',
|
||||
{
|
||||
'version': '2.1',
|
||||
'services': {
|
||||
'web': {
|
||||
'image': 'example/web',
|
||||
'labels': ['label_key=label_val']
|
||||
},
|
||||
'db': {
|
||||
'image': 'example/db',
|
||||
'labels': {
|
||||
'label_key': 'label_val'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
||||
details = config.ConfigDetails('.', [base_file])
|
||||
service_dicts = config.load(details).services
|
||||
for service in service_dicts:
|
||||
assert service['labels'] == {
|
||||
'label_key': 'label_val'
|
||||
}
|
||||
|
||||
def test_load_config_volume_and_network_labels(self):
|
||||
base_file = config.ConfigFile(
|
||||
'base.yaml',
|
||||
|
@ -435,30 +461,23 @@ class ConfigTest(unittest.TestCase):
|
|||
)
|
||||
|
||||
details = config.ConfigDetails('.', [base_file])
|
||||
network_dict = config.load(details).networks
|
||||
volume_dict = config.load(details).volumes
|
||||
loaded_config = config.load(details)
|
||||
|
||||
self.assertEqual(
|
||||
network_dict,
|
||||
{
|
||||
'with_label': {
|
||||
'labels': {
|
||||
'label_key': 'label_val'
|
||||
}
|
||||
assert loaded_config.networks == {
|
||||
'with_label': {
|
||||
'labels': {
|
||||
'label_key': 'label_val'
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
self.assertEqual(
|
||||
volume_dict,
|
||||
{
|
||||
'with_label': {
|
||||
'labels': {
|
||||
'label_key': 'label_val'
|
||||
}
|
||||
assert loaded_config.volumes == {
|
||||
'with_label': {
|
||||
'labels': {
|
||||
'label_key': 'label_val'
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
def test_load_config_invalid_service_names(self):
|
||||
for invalid_name in ['?not?allowed', ' ', '', '!', '/', '\xe2']:
|
||||
|
|
Loading…
Reference in New Issue