diff --git a/library/ceph_volume.py b/library/ceph_volume.py index 045649ab0..378f7a9d6 100644 --- a/library/ceph_volume.py +++ b/library/ceph_volume.py @@ -182,14 +182,7 @@ def container_exec(binary, container_image): ''' Build the docker CLI to run a command inside a container ''' -<<<<<<< HEAD - - command_exec = ['docker', 'run', '--rm', '--privileged', '--net=host', -======= - container_binary = os.getenv('CEPH_CONTAINER_BINARY') - command_exec = [container_binary, 'run', - '--rm', '--privileged', '--net=host', '--ipc=host', ->>>>>>> 15812970... cv: expose host ipc namespace to ceph-volume container + command_exec = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', '-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', diff --git a/library/test_ceph_volume.py b/library/test_ceph_volume.py index e72b74266..df020e479 100644 --- a/library/test_ceph_volume.py +++ b/library/test_ceph_volume.py @@ -39,7 +39,7 @@ class TestCephVolumeModule(object): def test_container_exec(sefl): fake_binary = "ceph-volume" fake_container_image = "docker.io/ceph/daemon:latest-luminous" - expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 + expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501 '-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 @@ -55,7 +55,7 @@ class TestCephVolumeModule(object): fake_module = MagicMock() fake_module.params = {'data': '/dev/sda'} fake_container_image = "docker.io/ceph/daemon:latest-luminous" - expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 + expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501 '-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 @@ -123,7 +123,7 @@ class TestCephVolumeModule(object): fake_module = MagicMock() fake_module.params = {'cluster': 'ceph', 'data': '/dev/sda'} fake_container_image = "docker.io/ceph/daemon:latest-luminous" - expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 + expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501 '-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 @@ -150,7 +150,7 @@ class TestCephVolumeModule(object): fake_action = "create" fake_container_image = "docker.io/ceph/daemon:latest-luminous" - expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 + expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501 '-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 @@ -198,7 +198,7 @@ class TestCephVolumeModule(object): fake_action = "prepare" fake_container_image = "docker.io/ceph/daemon:latest-luminous" - expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 + expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501 '-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 @@ -247,7 +247,7 @@ class TestCephVolumeModule(object): 'batch_devices': ["/dev/sda", "/dev/sdb"]} fake_container_image = "docker.io/ceph/daemon:latest-luminous" - expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 + expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501 '-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501