Commit 6c22fb7f authored by 黎博's avatar 黎博

修复bug

parent fefc5ae6
......@@ -324,7 +324,9 @@ public class K8sService {
public Map<String, Map<String, Object>> assign(String serviceName, Map<String, Map<String, Object>> podServiceMap, Map<String, Object> otherMap) {
Map<String, Object> podService = podServiceMap.get(serviceName);
for (Map.Entry<String, Object> entry: otherMap.entrySet()) {
podService.put(entry.getKey(), entry.getValue());
if (podService != null) {
podService.put(entry.getKey(), entry.getValue());
}
}
podServiceMap.put(serviceName, podService);
return podServiceMap;
......@@ -405,10 +407,10 @@ public class K8sService {
public Map<String, Object> formatIngressInfo(Ingress ingress) {
Map<String, Object> ingressMap = new HashMap<>();
if (ingress.getSpec().getRules().size() > 0) {
if (ingress.getSpec().getRules() != null && ingress.getSpec().getRules().size() > 0) {
ingressMap.put("host", ingress.getSpec().getRules().get(0).getHost());
} else {
ingressMap.put("host", null);
ingressMap.put("host", "");
}
return ingressMap;
}
......
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