From d33bbb877db887087adf4335f75d09fca4d9af26 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Thu, 25 May 2017 14:30:12 -0400 Subject: [PATCH] Add --ipc support This patch allows paunch to optionally configure docker containers with --ipc=host. This is required for some configurations of OpenStack Cinder using local machine LVM storage. Change-Id: I8d8f0bcc50c0a7364fc6e3b84dd573f7e7439c3b Partial-bug: #1668920 --- paunch/builder/compose1.py | 2 ++ paunch/tests/test_builder_compose1.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/paunch/builder/compose1.py b/paunch/builder/compose1.py index 312f8dc..9c654a9 100644 --- a/paunch/builder/compose1.py +++ b/paunch/builder/compose1.py @@ -137,6 +137,8 @@ class ComposeV1Builder(object): cmd.append('--env=%s' % v) if 'net' in cconfig: cmd.append('--net=%s' % cconfig['net']) + if 'ipc' in cconfig: + cmd.append('--ipc=%s' % cconfig['ipc']) if 'pid' in cconfig: cmd.append('--pid=%s' % cconfig['pid']) if 'privileged' in cconfig: diff --git a/paunch/tests/test_builder_compose1.py b/paunch/tests/test_builder_compose1.py index 59b8a86..3026494 100644 --- a/paunch/tests/test_builder_compose1.py +++ b/paunch/tests/test_builder_compose1.py @@ -314,6 +314,7 @@ three-12345678 three''', '', 0), 'privileged': True, 'user': 'bar', 'net': 'host', + 'ipc': 'host', 'pid': 'container:bar', 'restart': 'always', 'env_file': '/tmp/foo.env', @@ -326,7 +327,7 @@ three-12345678 three''', '', 0), self.assertEqual( ['docker', 'run', '--name', 'one', '--detach=true', '--env-file=/tmp/foo.env', - '--net=host', '--pid=container:bar', + '--net=host', '--ipc=host', '--pid=container:bar', '--privileged=true', '--restart=always', '--user=bar', 'centos:7'], cmd