Added support for cgroup_parent

This change adds cgroup-parent support to compose project. It allows
each service to specify a 'cgroup_parent' option.

Signed-off-by: Mohit Soni <mosoni@paypal.com>
This commit is contained in:
Mohit Soni 2015-09-30 00:25:26 -07:00 committed by Mazz Mosley
commit f4efa29377
5 changed files with 19 additions and 1 deletions

View file

@ -353,6 +353,13 @@ class ServiceTest(unittest.TestCase):
service.create_container(do_build=False)
self.assertFalse(self.mock_client.build.called)
def test_create_container_no_build_cgroup_parent(self):
service = Service('foo', client=self.mock_client, build='.')
service.image = lambda: {'Id': 'abc123'}
service.create_container(do_build=False, cgroup_parent='test')
self.assertFalse(self.mock_client.build.called)
def test_create_container_no_build_but_needs_build(self):
service = Service('foo', client=self.mock_client, build='.')
service.image = lambda *args, **kwargs: mock_get_image([])