refactor(接口测试): 修改 pod 选择条件
This commit is contained in:
parent
c16d276441
commit
0672393488
|
@ -9,6 +9,7 @@ import io.metersphere.sdk.exception.MSException;
|
||||||
import io.metersphere.sdk.util.JSON;
|
import io.metersphere.sdk.util.JSON;
|
||||||
import io.metersphere.sdk.util.LogUtils;
|
import io.metersphere.sdk.util.LogUtils;
|
||||||
import io.metersphere.system.dto.pool.TestResourceDTO;
|
import io.metersphere.system.dto.pool.TestResourceDTO;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -36,7 +37,7 @@ public class KubernetesProvider {
|
||||||
.inNamespace(credential.getNamespace())
|
.inNamespace(credential.getNamespace())
|
||||||
.list().getItems()
|
.list().getItems()
|
||||||
.stream()
|
.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();
|
.toList();
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(nodePods)) {
|
if (CollectionUtils.isEmpty(nodePods)) {
|
||||||
|
|
Loading…
Reference in New Issue