FrankChen021 commented on code in PR #17898:
URL: https://github.com/apache/druid/pull/17898#discussion_r2037198609


##########
extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/KubernetesPeonClient.java:
##########
@@ -198,10 +196,10 @@ public Optional<InputStream> getPeonLogs(K8sTaskId taskId)
 
   public List<Job> getPeonJobs()
   {
-    if (overlordMaybeInAnotherNamespace) {
-      return getPeonJobsWithOverlordNamespaceKeyLabels();
-    }
-    return getPeonJobsWithoutOverlordNamespaceKeyLabels();
+    boolean overlordNamespaceNotConfigured = this.overlordNamespace == null;

Review Comment:
   ```suggestion
       boolean overlordNamespaceNotConfigured = this.overlordNamespace == null 
|| this.overlordNamespace.isEmpty();
   ```



##########
extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/PodTemplateTaskAdapter.java:
##########
@@ -267,13 +267,13 @@ private Map<String, String> 
getPodTemplateAnnotations(Task task) throws IOExcept
   
   private Map<String, String> getJobLabels(KubernetesTaskRunnerConfig config, 
Task task)
   {
-    // Namespace is required, or else getOverlordNamespace() will return null, 
and this will not work correctly.
     Preconditions.checkNotNull(config.getNamespace(), "When using Custom Pod 
Templates, druid.indexer.runner.namespace cannot be null.");
+    String overlordNamespace = config.getOverlordNamespace() == null ? 
config.getNamespace() : config.getOverlordNamespace();

Review Comment:
   ```suggestion
       String overlordNamespace = config.getOverlordNamespace() == null || 
config.getOverlordNamespace().isEmpty() ? config.getNamespace() : 
config.getOverlordNamespace();
   ```



-- 
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