fix: 修复K8s执行 pod 过滤错误
Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
parent
eabe03a8e8
commit
6c74445829
|
@ -15,7 +15,6 @@ import org.springframework.util.CollectionUtils;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class KubernetesApiExec {
|
||||
|
||||
|
@ -24,7 +23,10 @@ public class KubernetesApiExec {
|
|||
if (CollectionUtils.isEmpty(pods)) {
|
||||
MSException.throwException("Execution node not found");
|
||||
}
|
||||
List<Pod> nodePods = pods.stream().filter(s -> s.getStatus().getPhase().equals("Running") && s.getMetadata().getGenerateName().startsWith(credential.getDeployName())).collect(Collectors.toList());
|
||||
List<Pod> nodePods = pods.stream()
|
||||
.filter(s -> s.getStatus().getPhase().equals("Running") && StringUtils.startsWith(s.getMetadata().getGenerateName(), credential.getDeployName()))
|
||||
.toList();
|
||||
|
||||
if (CollectionUtils.isEmpty(nodePods)) {
|
||||
MSException.throwException("Execution node not found");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue