diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/engine/KubernetesExecEngine.java b/backend/services/api-test/src/main/java/io/metersphere/api/engine/KubernetesExecEngine.java index 5859b6a9a5..b403fe8c0d 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/engine/KubernetesExecEngine.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/engine/KubernetesExecEngine.java @@ -26,8 +26,8 @@ public class KubernetesExecEngine implements ApiEngine { /** * 单调执行构造函数 * - * @param request - * @param resource + * @param request 任务请求参数 + * @param resource 资源池 */ public KubernetesExecEngine(TaskRequestDTO request, TestResourceDTO resource) { this.request = request; @@ -37,8 +37,8 @@ public class KubernetesExecEngine implements ApiEngine { /** * 批量执行构造函数 * - * @param batchRequestDTO - * @param resource + * @param batchRequestDTO 批量任务请求参数 + * @param resource 资源池 */ public KubernetesExecEngine(TaskBatchRequestDTO batchRequestDTO, TestResourceDTO resource) { this.resource = resource; @@ -48,8 +48,8 @@ public class KubernetesExecEngine implements ApiEngine { /** * 停止执行构造函数 * - * @param reportIds - * @param resource + * @param reportIds 任务ID列表 + * @param resource 资源池 */ public KubernetesExecEngine(List reportIds, TestResourceDTO resource) { this.resource = resource; diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/engine/KubernetesProvider.java b/backend/services/api-test/src/main/java/io/metersphere/api/engine/KubernetesProvider.java index 2fc324adbd..a57110a123 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/engine/KubernetesProvider.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/engine/KubernetesProvider.java @@ -68,8 +68,8 @@ public class KubernetesProvider { /** * 执行命令 * - * @param resource - * @param command + * @param resource 资源 + * @param command 命令 */ protected static void exec(TestResourceDTO resource, Object runRequest, String command) { KubernetesClient client = getKubernetesClient(resource); @@ -150,7 +150,6 @@ public class KubernetesProvider { .redirectingInput() .writingOutput(System.out) .writingError(System.err) - .withTTY() .usingListener(new SimpleListener(runRequest, client)) .exec(SHELL_COMMAND, "-c", command); } catch (Exception e) { @@ -167,7 +166,7 @@ public class KubernetesProvider { @Override public void onFailure(Throwable t, Response response) { LogUtils.error("K8s 监听失败", t); - if (runRequest != null && !(t instanceof SocketException)) { + if (runRequest != null) { handleGeneralError(runRequest, t); } }