in log4j-spring-cloud-config-sample-application/src/main/java/org/apache/logging/log4j/spring/cloud/config/sample/controller/K8SController.java [49:63]
public ResponseEntity<Pod> getPod() {
try {
KubernetesClient client = new KubernetesClientBuilder().build();
if (client != null) {
Pod pod = getCurrentPod(client);
if (pod != null) {
LOGGER.info("Pod: {}", objectMapper.writeValueAsString(pod));
return new ResponseEntity<>(pod, HttpStatus.OK);
}
}
} catch (Exception ex) {
LOGGER.error("Unable to obtain or print Pod information", ex);
}
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}