diff --git a/src/hyperpod_cli/service/exec_command.py b/src/hyperpod_cli/service/exec_command.py index 88fd37a7..2fb6ac2d 100644 --- a/src/hyperpod_cli/service/exec_command.py +++ b/src/hyperpod_cli/service/exec_command.py @@ -34,15 +34,7 @@ def exec_command( all_pods: Optional[bool], bash_command: tuple, ): - before_seperator = bash_command[: bash_command.index("-")] - - if before_seperator: - raise RuntimeError( - f"please provide bash command after -, unexpected char found {before_seperator}" - ) - - after_seperator = bash_command[bash_command.index("-") + 1 :] - bash_command_str: str = " ".join(after_seperator) + bash_command_str: str = " ".join(bash_command) k8s_client = KubernetesClient() list_pods_service = ListPods() diff --git a/test/unit_tests/service/test_exec_command_service.py b/test/unit_tests/service/test_exec_command_service.py index f363adab..9ec6835c 100644 --- a/test/unit_tests/service/test_exec_command_service.py +++ b/test/unit_tests/service/test_exec_command_service.py @@ -57,7 +57,6 @@ def test_exec_with_pod_without_namespace( None, False, ( - "-", "date", ), ) @@ -86,7 +85,6 @@ def test_exec_with_pod_with_namespace( "kubeflow", False, ( - "-", "date", ), ) @@ -110,23 +108,6 @@ def test_exec_with_pod_with_namespace_unknown_pod( "kubeflow", False, ( - "-", - "date", - ), - ) - - def test_exec_with_input_before_dash_raises_exception( - self, - ): - with self.assertRaises(RuntimeError): - self.mock_exec_command.exec_command( - "sample-job", - "sample-job-master-0", - "kubeflow", - False, - ( - "date", - "-", "date", ), ) @@ -154,7 +135,6 @@ def test_exec_with_pod_with_namespace_all_pod( "kubeflow", True, ( - "-", "date", ), ) @@ -184,7 +164,6 @@ def test_exec_with_pod_with_namespace_all_pod_api_exception( "kubeflow", True, ( - "-", "date", ), )