aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main
diff options
context:
space:
mode:
authorMorten Tokle <mortent@yahooinc.com>2022-09-13 14:47:17 +0200
committerMorten Tokle <mortent@yahooinc.com>2022-09-13 14:47:17 +0200
commit8c1062b6fd62c6948610eb41b72617be581b7dbf (patch)
treee4035d9fb2c33dc337cc00af82811a89a05521f2 /config-model/src/main
parent02fc1590ec8b7809ed1e7b5511fd510fd2d89be6 (diff)
Read flag when setting up document api
Diffstat (limited to 'config-model/src/main')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java12
1 files changed, 7 insertions, 5 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 4c94708d892..bb45c509b5b 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
@@ -194,7 +194,7 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
addProcessing(deployState, spec, cluster);
addSearch(deployState, spec, cluster);
addDocproc(deployState, spec, cluster);
- addDocumentApi(spec, cluster); // NOTE: Must be done after addSearch
+ addDocumentApi(deployState, spec, cluster); // NOTE: Must be done after addSearch
cluster.addDefaultHandlersExceptStatus();
addStatusHandlers(cluster, context.getDeployState().isHosted());
@@ -520,8 +520,8 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
return http;
}
- private void addDocumentApi(Element spec, ApplicationContainerCluster cluster) {
- ContainerDocumentApi containerDocumentApi = buildDocumentApi(cluster, spec);
+ private void addDocumentApi(DeployState deployState, Element spec, ApplicationContainerCluster cluster) {
+ ContainerDocumentApi containerDocumentApi = buildDocumentApi(deployState, cluster, spec);
if (containerDocumentApi == null) return;
cluster.setDocumentApi(containerDocumentApi);
@@ -919,13 +919,15 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
: bindingPattern;
}
- private ContainerDocumentApi buildDocumentApi(ApplicationContainerCluster cluster, Element spec) {
+ private ContainerDocumentApi buildDocumentApi(DeployState deployState, ApplicationContainerCluster cluster, Element spec) {
Element documentApiElement = XML.getChild(spec, "document-api");
if (documentApiElement == null) return null;
ContainerDocumentApi.HandlerOptions documentApiOptions = DocumentApiOptionsBuilder.build(documentApiElement);
Element ignoreUndefinedFields = XML.getChild(documentApiElement, "ignore-undefined-fields");
- OptionalInt portBindingOverride = cluster.isHostedVespa()? OptionalInt.of(HOSTED_VESPA_DATAPLANE_PORT) : OptionalInt.empty();
+ OptionalInt portBindingOverride = deployState.featureFlags().useRestrictedDataPlaneBindings() && deployState.isHosted()
+ ? OptionalInt.of(HOSTED_VESPA_DATAPLANE_PORT)
+ : OptionalInt.empty();
return new ContainerDocumentApi(cluster, documentApiOptions,
"true".equals(XML.getValue(ignoreUndefinedFields)), portBindingOverride);
}