uds5501 commented on code in PR #18413:
URL: https://github.com/apache/druid/pull/18413#discussion_r2295850206


##########
embedded-tests/src/test/java/org/apache/druid/testing/embedded/k8s/K3sClusterResource.java:
##########
@@ -138,35 +141,61 @@ protected K3sContainer createContainer()
   @Override
   public void onStarted(EmbeddedDruidCluster cluster)
   {
-    client = new KubernetesClientBuilder()
-        .withConfig(Config.fromKubeconfig(getContainer().getKubeConfigYaml()))
-        .build();
-    closer.register(client);
+    loadImageAndApplyClusterManifests(cluster);
+    injectClusterCommonPropertiesToConfigMap(cluster);
+    initializeDruidServices();
+  }
 
-    loadLocalDockerImageIntoContainer(druidImageName, cluster.getTestFolder());
+  private void initializeDruidServices()
+  {
+    for (K3sDruidService druidService : services) {
+      final String serviceConfigMap = StringUtils.format(SERVICE_CONFIG_MAP, 
druidService.getName());
+      applyConfigMap(
+          newConfigMap(serviceConfigMap, druidService.getProperties(), 
"runtime.properties")
+      );
+      applyManifest(druidService);
+    }
 
-    manifestFiles.forEach(this::applyManifest);
+    waitUntilPodsAreReady(DRUID_NAMESPACE);
+    waitUntilServicesAreHealthy();
+  }
+
+  protected void waitUntilServicesAreHealthy()
+  {
+    services.forEach(this::waitUntilServiceIsHealthy);
+  }
+
+  protected List<K3sDruidService> getServices()
+  {
+    return services;
+  }
 
-    // Create common config map
+  protected Properties 
injectClusterCommonPropertiesToConfigMap(EmbeddedDruidCluster cluster)

Review Comment:
   I wanted to utilize the common function to return the common properties 
that'll be required to be baked in the yaml, this seemed like a decent way to 
get them. The other way would've been using a `super.getCommonProperties()` I 
guess. [for the operator context, we don't really need to push the common props 
to the k8s btw]



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