Commit 54fa1b5a authored by 黎博's avatar 黎博

修复获取pod列表为空的情况

parent 78a49b35
......@@ -317,7 +317,13 @@ public class K8sService {
String serviceName = ingress.getMetadata().getName();
podServiceMap = assign(serviceName, podServiceMap, formatIngressInfo(ingress));
}
return new ArrayList<>(podServiceMap.values());
List<Map<String, Object>> resultList = new ArrayList<>();
for (Map<String, Object> map: podServiceMap.values()) {
if (map != null) {
resultList.add(map);
}
}
return resultList;
}
public Map<String, Map<String, Object>> assign(String serviceName, Map<String, Map<String, Object>> podServiceMap, Map<String, Object> otherMap) {
......@@ -2189,6 +2195,6 @@ public class K8sService {
// k8sService.createNewNamespace("test6", "dev", "黎博");
// k8sService.podTest();
// k8sService.getPodList("k8s");
k8sService.podTest();
System.out.println(JSON.toJSONString(k8sService.getPodListNew("fe")));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment