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


##########
embedded-tests/src/test/java/org/apache/druid/testing/embedded/k8s/K3sDruidService.java:
##########
@@ -36,20 +38,42 @@
  */
 public class K3sDruidService
 {
-  private static final String MANIFEST_TEMPLATE = 
"manifests/druid-service.yaml";
-
   private final DruidCommand command;
   private final Properties properties;
+  private boolean isGovernedByOperator = false;
+  private String manifestTemplate = "manifests/druid-service.yaml";
+  private Map<String, String> operatorVariablesTemplate = Map.of();
 
   public K3sDruidService(DruidCommand command)
   {
     this.command = command;
     this.properties = new Properties();
 
-    addProperty("druid.host", EmbeddedHostname.containerFriendly().toString());
+    // Don't set druid.host here - it will be set when operator variables are 
available
     command.getDefaultProperties().forEach(properties::setProperty);
   }
 
+  public K3sDruidService governWithOperator()
+  {
+    this.operatorVariablesTemplate = new 
HashMap<>(command.getOperatorConfiguration());
+    this.isGovernedByOperator = true;
+    this.manifestTemplate = "manifests/druid-service-operator.yaml";
+    return this;
+  }

Review Comment:
   Instead of doing this, pass in the template file to use and try to reuse the 
template variables such as `${service}` etc.
   
   Edit: If needed, we can add a few extra steps while doing the template 
replacement in `createManifestYaml`.



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