From 06723934887e5b56d61fbd8a22ab363b81e49b4b Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 11 Oct 2024 12:41:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=20pod=20=E9=80=89=E6=8B=A9=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/api/engine/KubernetesProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 faca326b09..ec669f65b0 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 @@ -9,6 +9,7 @@ import io.metersphere.sdk.exception.MSException; import io.metersphere.sdk.util.JSON; import io.metersphere.sdk.util.LogUtils; import io.metersphere.system.dto.pool.TestResourceDTO; +import org.apache.commons.lang3.StringUtils; import org.springframework.util.CollectionUtils; import java.util.List; @@ -36,7 +37,7 @@ public class KubernetesProvider { .inNamespace(credential.getNamespace()) .list().getItems() .stream() - .filter(s -> RUNNING_PHASE.equals(s.getStatus().getPhase())) + .filter(s -> RUNNING_PHASE.equals(s.getStatus().getPhase()) && StringUtils.startsWith(s.getMetadata().getGenerateName(), "task-runner")) .toList(); if (CollectionUtils.isEmpty(nodePods)) {