summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorØyvind Grønnesby <oyving@verizonmedia.com>2019-06-28 09:56:21 +0200
committerØyvind Grønnesby <oyving@verizonmedia.com>2019-06-28 09:56:21 +0200
commitc026958c9e37145a2284f0b498331feacb31719c (patch)
treee2920d3d0b591f3b7a95e1ed4798078ac09c02e9
parent44e40370760befb611100e0afacc701b4c027ebd (diff)
Take endpoints into account when generating EndpointList
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Application.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Application.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Application.java
index c168d09a15a..b5bf5a7cc98 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Application.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Application.java
@@ -6,6 +6,7 @@ import com.yahoo.component.Version;
import com.yahoo.config.application.api.DeploymentSpec;
import com.yahoo.config.application.api.ValidationOverrides;
import com.yahoo.config.provision.ApplicationId;
+import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.Environment;
import com.yahoo.config.provision.HostName;
import com.yahoo.config.provision.SystemName;
@@ -19,6 +20,8 @@ import com.yahoo.vespa.hosted.controller.application.AssignedRotation;
import com.yahoo.vespa.hosted.controller.application.Change;
import com.yahoo.vespa.hosted.controller.application.Deployment;
import com.yahoo.vespa.hosted.controller.application.DeploymentJobs;
+import com.yahoo.vespa.hosted.controller.application.Endpoint;
+import com.yahoo.vespa.hosted.controller.application.EndpointId;
import com.yahoo.vespa.hosted.controller.application.EndpointList;
import com.yahoo.vespa.hosted.controller.application.RotationStatus;
import com.yahoo.vespa.hosted.controller.rotation.RotationId;
@@ -214,12 +217,18 @@ public class Application {
return rotations;
}
+ /** Returns the default global endpoints for this in given system - for a given endpoint ID */
+ public EndpointList endpointsIn(SystemName system, EndpointId endpointId) {
+ if (rotations.isEmpty()) return EndpointList.EMPTY;
+ return EndpointList.defaultGlobal(id, endpointId, system);
+ }
+
/** Returns the default global endpoints for this in given system */
public EndpointList endpointsIn(SystemName system) {
- // TODO: Do we need to change something here? .defaultGlobalId seems like it is
- // TODO: making some assumptions on naming.
if (rotations.isEmpty()) return EndpointList.EMPTY;
- return EndpointList.defaultGlobal(id, system);
+ final var endpointStream = rotations.stream()
+ .flatMap(rotation -> EndpointList.defaultGlobal(id, rotation.endpointId(), system).asList().stream());
+ return EndpointList.of(endpointStream);
}
public Optional<String> pemDeployKey() { return pemDeployKey; }