in log4j-spring-cloud-config-sample-application/src/main/java/org/apache/logging/log4j/spring/cloud/config/sample/controller/K8SController.java [64:74]
private Pod getCurrentPod(KubernetesClient kubernetesClient) {
String hostName = System.getenv(HOSTNAME);
try {
if (isServiceAccount() && Strings.isNotBlank(hostName)) {
return kubernetesClient.pods().withName(hostName).get();
}
} catch (Throwable t) {
LOGGER.debug("Unable to locate pod with name {}.", hostName);
}
return null;
}