mirror of https://github.com/docker/compose.git
Disable the use of 'net' in v2
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
69ed5f9c48
commit
35e347cf92
|
@ -89,7 +89,6 @@
|
|||
"mac_address": {"type": "string"},
|
||||
"mem_limit": {"type": ["number", "string"]},
|
||||
"memswap_limit": {"type": ["number", "string"]},
|
||||
"net": {"type": "string"},
|
||||
"pid": {"type": ["string", "null"]},
|
||||
|
||||
"ports": {
|
||||
|
|
|
@ -422,6 +422,30 @@ class CLITestCase(DockerClientTestCase):
|
|||
self.assertEqual(len(db.containers()), 1)
|
||||
self.assertEqual(len(console.containers()), 0)
|
||||
|
||||
def test_up_with_net_is_invalid(self):
|
||||
self.base_dir = 'tests/fixtures/net-container'
|
||||
|
||||
result = self.dispatch(
|
||||
['-f', 'v2-invalid.yml', 'up', '-d'],
|
||||
returncode=1)
|
||||
|
||||
# TODO: fix validation error messages for v2 files
|
||||
# assert "Unsupported config option for service 'web': 'net'" in exc.exconly()
|
||||
assert "Unsupported config option" in result.stderr
|
||||
|
||||
def test_up_with_net_v1(self):
|
||||
self.base_dir = 'tests/fixtures/net-container'
|
||||
self.dispatch(['up', '-d'], None)
|
||||
|
||||
bar = self.project.get_service('bar')
|
||||
bar_container = bar.containers()[0]
|
||||
|
||||
foo = self.project.get_service('foo')
|
||||
foo_container = foo.containers()[0]
|
||||
|
||||
assert foo_container.get('HostConfig.NetworkMode') == \
|
||||
'container:{}'.format(bar_container.id)
|
||||
|
||||
def test_up_with_no_deps(self):
|
||||
self.base_dir = 'tests/fixtures/links-composefile'
|
||||
self.dispatch(['up', '-d', '--no-deps', 'web'], None)
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
foo:
|
||||
image: busybox
|
||||
command: top
|
||||
net: "container:bar"
|
||||
bar:
|
||||
image: busybox
|
||||
command: top
|
|
@ -0,0 +1,10 @@
|
|||
version: 2
|
||||
|
||||
services:
|
||||
foo:
|
||||
image: busybox
|
||||
command: top
|
||||
bar:
|
||||
image: busybox
|
||||
command: top
|
||||
net: "container:foo"
|
Loading…
Reference in New Issue