You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "nlippis (via GitHub)" <gi...@apache.org> on 2023/03/23 13:10:44 UTC

[GitHub] [druid] nlippis commented on a diff in pull request #13966: Hook up pod template adapter

nlippis commented on code in PR #13966:
URL: https://github.com/apache/druid/pull/13966#discussion_r1146176073


##########
extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/KubernetesTaskRunnerFactory.java:
##########
@@ -84,18 +93,58 @@ public KubernetesTaskRunner build()
       client = new DruidKubernetesClient();
     }
 
-    K8sTaskAdapter adapter;
-    if (kubernetesTaskRunnerConfig.sidecarSupport) {
-      adapter = new MultiContainerTaskAdapter(
+    runner = new KubernetesTaskRunner(
+        buildTaskAdapter(client),
+        kubernetesTaskRunnerConfig,
+        taskQueueConfig,
+        taskLogPusher,
+        new DruidKubernetesPeonClient(client, kubernetesTaskRunnerConfig.namespace, kubernetesTaskRunnerConfig.debugJobs)
+    );
+    return runner;
+  }
+
+  @Override
+  public KubernetesTaskRunner get()
+  {
+    return runner;
+  }
+
+  private TaskAdapter buildTaskAdapter(DruidKubernetesClient client)
+  {
+    String adapter = properties.getProperty(String.format(
+        Locale.ROOT,
+        "%s.%s.adapter.type",
+        IndexingServiceModuleHelper.INDEXER_RUNNER_PROPERTY_PREFIX,
+        TYPE_NAME
+    ));
+
+    if (adapter != null && !MultiContainerTaskAdapter.TYPE.equals(adapter) && kubernetesTaskRunnerConfig.sidecarSupport) {
+      throw new IAE(
+          "Only kubernetes pod adapter [%s] can be specified when sidecarSupport is enabled",

Review Comment:
   The value of the adapter is interpolated here, check the next line that specifies `MultiContainerTaskAdapter.TYPE` as a format argument.



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org