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


##########
embedded-tests/src/test/java/org/apache/druid/testing/embedded/k8s/K3sDruidService.java:
##########
@@ -67,22 +96,36 @@ public String createManifestYaml(String druidImage)
   {
     try {
       final String template = Files.readString(
-          Resources.getFileForResource(MANIFEST_TEMPLATE).toPath()
+          Resources.getFileForResource(manifestTemplate).toPath()
       );
 
       String manifest = StringUtils.replace(template, "${service}", getName());
       manifest = StringUtils.replace(manifest, "${command}", 
command.getName());
-      manifest = StringUtils.replace(manifest, "${port}", 
String.valueOf(command.getExposedPorts()[0]));
+      manifest = StringUtils.replace(manifest, "${port}", 
String.valueOf(druidPort));
       manifest = StringUtils.replace(manifest, "${image}", druidImage);
       manifest = StringUtils.replace(manifest, "${serviceFolder}", 
getServicePropsFolder());
-
+      manifest = StringUtils.replace(manifest, KEY_COMMON_RUNTIME_PROPERTIES, 
buildPropertiesString(commonProperties, 4));
+      manifest = StringUtils.replace(manifest, KEY_NODE_RUNTIME_PROPERTIES, 
buildPropertiesString(properties, 8));
       return manifest;
     }
     catch (Exception e) {
       throw new ISE(e, "Could not create manifest for service[%s]", command);
     }
   }
 
+  /**
+   * Builds a properties string to be used in the manifest.yaml file 
supporting a uniform indentation.
+   */
+  private String buildPropertiesString(Properties properties, int 
indentationSpaces)

Review Comment:
   This method should probably exist in the new class 
`K3sClusterResourceWithOperator` since that is where we will actually use it 
for the substitution.



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