kfaraz commented on code in PR #18413:
URL: https://github.com/apache/druid/pull/18413#discussion_r2295855523
##########
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:
The common properties are already available in the cluster object passed in
to onStarted. It would be simpler to just get that directly. Then we could make
this method `private void`.
--
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]