Commit c8074754 authored by 黎博's avatar 黎博

对pod列表根据serviceName排序

parent 54fa1b5a
......@@ -317,12 +317,19 @@ public class K8sService {
String serviceName = ingress.getMetadata().getName();
podServiceMap = assign(serviceName, podServiceMap, formatIngressInfo(ingress));
}
// 对象转列表
List<Map<String, Object>> resultList = new ArrayList<>();
for (Map<String, Object> map: podServiceMap.values()) {
if (map != null) {
resultList.add(map);
}
}
// 根据serviceName对列表进行排序
Collections.sort(resultList, (m1, m2) -> {
String serviceName1 = m1.get("serviceName").toString();
String serviceName2 = m2.get("serviceName").toString();
return serviceName1.compareTo(serviceName2);
});
return resultList;
}
......
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