suneet-s commented on code in PR #14758:
URL: https://github.com/apache/druid/pull/14758#discussion_r1284961786


##########
extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesPeonLifecycle.java:
##########
@@ -250,8 +250,10 @@ protected TaskLocation getTaskLocation()
           podStatus.getPodIP(),
           DruidK8sConstants.PORT,
           DruidK8sConstants.TLS_PORT,
-          
Boolean.parseBoolean(pod.getMetadata().getAnnotations().getOrDefault(DruidK8sConstants.TLS_ENABLED,
 "false"))
+          
Boolean.parseBoolean(pod.getMetadata().getAnnotations().getOrDefault(DruidK8sConstants.TLS_ENABLED,
 "false")),
+          pod.getMetadata() != null ? pod.getMetadata().getName() : ""
       );
+      log.info(StringUtils.format("K8s task %s is running at location %s", 
taskId.getOriginalTaskId(), taskLocation));

Review Comment:
   It is better not to use StringUtils.format in the log message directly as 
this will cause the string to be formatted even if the log level is set to a 
higher level like `warn`
   
   ```suggestion
         log.info("K8s task %s is running at location %s", 
taskId.getOriginalTaskId(), taskLocation);
   ```
   
   Also, would a better place for this log line be in the `K8sTaskId` 
constructor? That way we are guaranteed that the log will be written once for 
any task with the original task id and the k8sJobName, even if getTaskLocation 
is never called.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to