Commit 7abcb7dc authored by 黎博's avatar 黎博

bug fix

parent 97286c99
......@@ -149,6 +149,7 @@ public class K8sService {
// 端口暴露在Service
Service service = kubernetesClient.services().inNamespace(namespace).withName(serviceName).get();
if (service != null) {
map.put("serviceType", service.getSpec().getType());
List<ServicePort> servicePortList = service.getSpec().getPorts();
if (servicePortList.size() > 0) {
for (ServicePort servicePort : servicePortList) {
......@@ -178,7 +179,6 @@ public class K8sService {
map.put("createdAt", podMetadata.getCreationTimestamp());
}
map.put("serviceName", serviceName);
map.put("serviceType", service.getSpec().getType());
map.put("podName", podMetadata.getName());
map.put("labels", podMetadata.getLabels());
List<ContainerStatus> containerStatuses = pod.getStatus().getContainerStatuses();
......
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