Set up logserver-container on tester nodes
@@ -72,21 +72,22 @@ public class DomAdminV4Builder extends DomAdminBuilderBase {
}
private void assignLogserver(DeployState deployState, NodesSpecification nodesSpecification, Admin admin) {
- if (nodesSpecification.minResources().nodes() > 1) throw new IllegalArgumentException("You can only request a single log server");
- if (nodesSpecification.isDedicated()) {
- Collection<HostResource> hosts = allocateHosts(admin.hostSystem(), "logserver", nodesSpecification);
+ if (nodesSpecification.minResources().nodes() > 1)
+ throw new IllegalArgumentException("You can only request a single log server");
+
+ Collection<HostResource> hosts = List.of();
+ if (nodesSpecification.isDedicated())
+ hosts = allocateHosts(admin.hostSystem(), "logserver", nodesSpecification);
+ else if (containerModels.iterator().hasNext())
+ hosts = sortedContainerHostsFrom(containerModels.iterator().next(), nodesSpecification.minResources().nodes(), false);
+ else
+ context.getDeployLogger().logApplicationPackage(Level.INFO, "No container host available to use for running logserver");
+
if (hosts.isEmpty()) return; // No log server can be created (and none is needed)
Logserver logserver = createLogserver(deployState, admin, hosts);
+ if (nodesSpecification.isDedicated() || deployState.isHosted() && deployState.getProperties().applicationId().instance().isTester())
createContainerOnLogserverHost(deployState, admin, logserver.getHostResource());
- } else if (containerModels.iterator().hasNext()) {
- List<HostResource> hosts = sortedContainerHostsFrom(containerModels.iterator().next(), nodesSpecification.minResources().nodes(), false);
- if (hosts.isEmpty()) return; // No log server can be created (and none is needed)
-
- createLogserver(deployState, admin, hosts);
- } else {
- context.getDeployLogger().logApplicationPackage(Level.INFO, "No container host available to use for running logserver");
- }
}
private NodesSpecification createNodesSpecificationForLogserver() {
