From 1007d7f4ebe20394887c0990c32db055dc81808e Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 14 Oct 2024 12:18:43 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E7=9A=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/api/engine/KubernetesProvider.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 b1314f2105..65346addbf 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 @@ -151,14 +151,14 @@ public class KubernetesProvider { .writingOutput(System.out) .writingError(System.err) .withTTY() - .usingListener(new SimpleListener(runRequest, client)) + .usingListener(new SimpleListener(runRequest)) .exec(SHELL_COMMAND, "-c", command); } catch (Exception e) { LogUtils.error("Failed to execute command on pod {} ", pod.getMetadata().getName(), e); } } - private record SimpleListener(Object runRequest, KubernetesClient client) implements ExecListener { + private record SimpleListener(Object runRequest) implements ExecListener { @Override public void onOpen() { LogUtils.info("K8s 开启监听"); @@ -175,8 +175,6 @@ public class KubernetesProvider { @Override public void onClose(int code, String reason) { LogUtils.info("K8s 监听关闭:code=" + code + ", reason=" + reason); - // 关闭客户端 - client.close(); } }