Commit 879ddc85 authored by 黎博's avatar 黎博

服务详情接口新增host字段

parent f5fdcfdf
......@@ -2173,6 +2173,14 @@ public class K8sService {
map.put("podIp", pod.getStatus().getPodIP());
map.put("startTime", pod.getStatus().getStartTime());
map.put("status", containerStatuses.get(0).getReady());
Ingress ingress = kubernetesClient.extensions().ingresses().inNamespace(namespace).withName(serviceName).get();
if (ingress != null) {
if (ingress.getSpec().getRules() != null && ingress.getSpec().getRules().size() > 0) {
map.put("host", ingress.getSpec().getRules().get(0).getHost());
} else {
map.put("host", "");
}
}
}
return map;
}
......
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