mirror of https://github.com/docker/compose.git
Merge pull request #3128 from dnephin/add_network_settings_to_config_hash
Include network settings as part of the service config hash.
This commit is contained in:
commit
c3eca82749
|
@ -498,7 +498,7 @@ class Service(object):
|
||||||
'image_id': self.image()['Id'],
|
'image_id': self.image()['Id'],
|
||||||
'links': self.get_link_names(),
|
'links': self.get_link_names(),
|
||||||
'net': self.network_mode.id,
|
'net': self.network_mode.id,
|
||||||
'networks': list(self.networks.keys()),
|
'networks': self.networks,
|
||||||
'volumes_from': [
|
'volumes_from': [
|
||||||
(v.source.name, v.mode)
|
(v.source.name, v.mode)
|
||||||
for v in self.volumes_from if isinstance(v.source, Service)
|
for v in self.volumes_from if isinstance(v.source, Service)
|
||||||
|
|
|
@ -1257,6 +1257,10 @@ class CLITestCase(DockerClientTestCase):
|
||||||
'logscomposefile_another_1',
|
'logscomposefile_another_1',
|
||||||
'exited'))
|
'exited'))
|
||||||
|
|
||||||
|
# sleep for a short period to allow the tailing thread to receive the
|
||||||
|
# event. This is not great, but there isn't an easy way to do this
|
||||||
|
# without being able to stream stdout from the process.
|
||||||
|
time.sleep(0.5)
|
||||||
os.kill(proc.pid, signal.SIGINT)
|
os.kill(proc.pid, signal.SIGINT)
|
||||||
result = wait_on_process(proc, returncode=1)
|
result = wait_on_process(proc, returncode=1)
|
||||||
assert 'test' in result.stdout
|
assert 'test' in result.stdout
|
||||||
|
|
|
@ -286,7 +286,7 @@ class ServiceTest(unittest.TestCase):
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
opts['labels'][LABEL_CONFIG_HASH],
|
opts['labels'][LABEL_CONFIG_HASH],
|
||||||
'f8bfa1058ad1f4231372a0b1639f0dfdb574dafff4e8d7938049ae993f7cf1fc')
|
'2524a06fcb3d781aa2c981fc40bcfa08013bb318e4273bfa388df22023e6f2aa')
|
||||||
assert opts['environment'] == ['also=real']
|
assert opts['environment'] == ['also=real']
|
||||||
|
|
||||||
def test_get_container_create_options_sets_affinity_with_binds(self):
|
def test_get_container_create_options_sets_affinity_with_binds(self):
|
||||||
|
@ -502,6 +502,7 @@ class ServiceTest(unittest.TestCase):
|
||||||
image='example.com/foo',
|
image='example.com/foo',
|
||||||
client=self.mock_client,
|
client=self.mock_client,
|
||||||
network_mode=ServiceNetworkMode(Service('other')),
|
network_mode=ServiceNetworkMode(Service('other')),
|
||||||
|
networks={'default': None},
|
||||||
links=[(Service('one'), 'one')],
|
links=[(Service('one'), 'one')],
|
||||||
volumes_from=[VolumeFromSpec(Service('two'), 'rw', 'service')])
|
volumes_from=[VolumeFromSpec(Service('two'), 'rw', 'service')])
|
||||||
|
|
||||||
|
@ -511,7 +512,7 @@ class ServiceTest(unittest.TestCase):
|
||||||
'options': {'image': 'example.com/foo'},
|
'options': {'image': 'example.com/foo'},
|
||||||
'links': [('one', 'one')],
|
'links': [('one', 'one')],
|
||||||
'net': 'other',
|
'net': 'other',
|
||||||
'networks': [],
|
'networks': {'default': None},
|
||||||
'volumes_from': [('two', 'rw')],
|
'volumes_from': [('two', 'rw')],
|
||||||
}
|
}
|
||||||
assert config_dict == expected
|
assert config_dict == expected
|
||||||
|
@ -532,7 +533,7 @@ class ServiceTest(unittest.TestCase):
|
||||||
'image_id': 'abcd',
|
'image_id': 'abcd',
|
||||||
'options': {'image': 'example.com/foo'},
|
'options': {'image': 'example.com/foo'},
|
||||||
'links': [],
|
'links': [],
|
||||||
'networks': [],
|
'networks': {},
|
||||||
'net': 'aaabbb',
|
'net': 'aaabbb',
|
||||||
'volumes_from': [],
|
'volumes_from': [],
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue