Remove the runtime constraint
This patch fixes the problem where the runtime had only choice "runc" and no other custom runtimes were not allowed. Now Zun supports running any custom runtime. Change-Id: I38efb4bee4aa7176ebfdcd3b5e817156a5f0f22d
This commit is contained in:
parent
3a3f4535b9
commit
ea8951309d
@ -145,10 +145,9 @@ class CreateContainer(command.ShowOne):
|
||||
help='Automatically remove the container when it exits')
|
||||
parser.add_argument(
|
||||
'--runtime',
|
||||
choices=['runc'],
|
||||
metavar='<runtime>',
|
||||
help='The container runtime tool to create container with. '
|
||||
'It can have following value: "runc"')
|
||||
'It can have value "runc" or any other custom runtime.')
|
||||
parser.add_argument(
|
||||
'--hostname',
|
||||
metavar='<hostname>',
|
||||
@ -689,9 +688,8 @@ class RunContainer(command.ShowOne):
|
||||
parser.add_argument(
|
||||
'--runtime',
|
||||
metavar='<runtime>',
|
||||
choices=['runc'],
|
||||
help='The container runtime tool to create container with. '
|
||||
'It can have following value: "runc"')
|
||||
'It can have value "runc" or any other custom runtime.')
|
||||
parser.add_argument(
|
||||
'--hostname',
|
||||
metavar='<hostname>',
|
||||
|
@ -159,14 +159,6 @@ class ShellTest(shell_test_base.TestCommandLineArgument):
|
||||
self._test_arg_success('run --runtime runc x')
|
||||
mock_show_container.assert_called_once_with('container')
|
||||
|
||||
@mock.patch('zunclient.v1.containers.ContainerManager.run')
|
||||
def test_zun_container_run_failure_with_wrong_runtime(
|
||||
self, mock_run):
|
||||
self._test_arg_failure(
|
||||
'run --runtime wrong x',
|
||||
self._invalid_choice_error)
|
||||
self.assertFalse(mock_run.called)
|
||||
|
||||
@mock.patch('zunclient.v1.containers_shell._show_container')
|
||||
@mock.patch('zunclient.v1.containers.ContainerManager.run')
|
||||
def test_zun_container_run_success_with_hostname(
|
||||
|
@ -114,9 +114,8 @@ def _show_container(container):
|
||||
'v6-fixed-ip: IPv6 fixed address for container.')
|
||||
@utils.arg('--runtime',
|
||||
metavar='<runtime>',
|
||||
choices=['runc'],
|
||||
help='The container runtime tool to create container with. '
|
||||
'It can have following value: "runc"')
|
||||
'It can have value "runc" or any other custom runtime.')
|
||||
@utils.arg('--hostname',
|
||||
metavar='<hostname>',
|
||||
default=None,
|
||||
@ -505,9 +504,8 @@ def do_kill(cs, args):
|
||||
'v6-fixed-ip: IPv6 fixed address for container.')
|
||||
@utils.arg('--runtime',
|
||||
metavar='<runtime>',
|
||||
choices=['runc'],
|
||||
help='The container runtime tool to create container with. '
|
||||
'It can have following value: "runc"')
|
||||
'It can have value "runc" or any other custom runtime.')
|
||||
@utils.arg('--hostname',
|
||||
metavar='<hostname>',
|
||||
default=None,
|
||||
|
Loading…
Reference in New Issue
Block a user