summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2020-03-16 16:44:31 +0100
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2020-03-17 15:14:34 +0100
commitcd94fe9d8619873b066c3dde986f0ee87f09e02d (patch)
treeeffc0c170d2b8f804d9ebed94caddaea2fc91233 /config-model
parentb2d5ec8958eaed2d5ab0bd6b52fd8450abc0d24a (diff)
Extract to method 'isHostedTenantApplication'
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
index 14e667aba00..1f78e3e71bb 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java
@@ -189,7 +189,7 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
cluster.addDefaultHandlersExceptStatus();
addStatusHandlers(cluster, context.getDeployState().isHosted());
- addHttp(deployState, spec, cluster, context.getApplicationType(), deployState.getProperties().applicationId().instance().isTester());
+ addHttp(deployState, spec, cluster, context);
addAccessLogs(deployState, cluster, spec);
addRoutingAliases(cluster, spec, deployState.zone().environment());
@@ -311,12 +311,12 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
}
- private void addHttp(DeployState deployState, Element spec, ApplicationContainerCluster cluster, ApplicationType applicationType, boolean isTesterApplication) {
+ private void addHttp(DeployState deployState, Element spec, ApplicationContainerCluster cluster, ConfigModelContext context) {
Element httpElement = XML.getChild(spec, "http");
if (httpElement != null) {
cluster.setHttp(buildHttp(deployState, cluster, httpElement));
}
- if (deployState.isHosted() && applicationType == ApplicationType.DEFAULT && !isTesterApplication) {
+ if (isHostedTenantApplication(context)) {
addAdditionalHostedConnector(deployState, cluster);
}
}
@@ -343,6 +343,12 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
}
}
+ private static boolean isHostedTenantApplication(ConfigModelContext context) {
+ var deployState = context.getDeployState();
+ boolean isTesterApplication = deployState.getProperties().applicationId().instance().isTester();
+ return deployState.isHosted() && context.getApplicationType() == ApplicationType.DEFAULT && !isTesterApplication;
+ }
+
private static void addImplicitHttpIfNotPresent(ApplicationContainerCluster cluster) {
if(cluster.getHttp() == null) {
Http http = new Http(Collections.emptyList());