aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java b/config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java
index daa237d90c1..02bb0b412d1 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/AbstractService.java
@@ -42,7 +42,7 @@ public abstract class AbstractService extends AbstractConfigProducer<AbstractCon
private int id = 0;
/** The actual base port for this Service. */
- private int basePort;
+ private int basePort = 0;
/** The ports allocated to this Service. */
private List<Integer> ports = new ArrayList<>();
@@ -483,8 +483,7 @@ public abstract class AbstractService extends AbstractConfigProducer<AbstractCon
* currently uses the first port as container http port.
*/
public void reservePortPrepended(int port, String suffix) {
- hostResource.reservePort(this, port, suffix);
- ports.add(0, port);
+ ports.add(0, hostResource.ports().requireNetworkPort(port, this, suffix));
}
public void setHostResource(HostResource hostResource) {