Remove ability to join bridge network + user-defined networks

Containers connected to the bridge network can't have aliases, so it's
simpler to rule that they can *either* be connected to the bridge
network (via `network_mode: bridge`) *or* be connected to user-defined
networks (via `networks` or the default network).

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2016-01-27 00:42:04 +00:00
commit 297d20f085
3 changed files with 6 additions and 30 deletions

View file

@ -470,16 +470,13 @@ def get_networks(service_dict, network_definitions):
networks = []
for name in service_dict.pop('networks', ['default']):
if name in ['bridge']:
networks.append(name)
matches = [n for n in network_definitions if n.name == name]
if matches:
networks.append(matches[0].full_name)
else:
matches = [n for n in network_definitions if n.name == name]
if matches:
networks.append(matches[0].full_name)
else:
raise ConfigurationError(
'Service "{}" uses an undefined network "{}"'
.format(service_dict['name'], name))
raise ConfigurationError(
'Service "{}" uses an undefined network "{}"'
.format(service_dict['name'], name))
return networks