diff options
Diffstat (limited to 'controller-server/src/main')
2 files changed, 9 insertions, 7 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/RoutingController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/RoutingController.java index be533b0c53b..16f12b3ac07 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/RoutingController.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/RoutingController.java @@ -243,7 +243,8 @@ public class RoutingController { Instance instance = application.require(instanceName); boolean registerLegacyNames = requiresLegacyNames(application.deploymentSpec(), instanceName); Set<ContainerEndpoint> containerEndpoints = new HashSet<>(); - EndpointList endpoints = declaredEndpointsOf(application); + DeploymentId deployment = new DeploymentId(instance.id(), zone); + EndpointList endpoints = declaredEndpointsOf(application).targets(deployment); EndpointList globalEndpoints = endpoints.scope(Endpoint.Scope.global); // Add endpoints backed by a rotation, and register them in DNS if necessary for (var assignedRotation : instance.rotations()) { @@ -280,9 +281,7 @@ public class RoutingController { } // Add endpoints not backed by a rotation (i.e. other routing methods so that the config server always knows // about global names, even when not using rotations) - DeploymentId deployment = new DeploymentId(instance.id(), zone); globalEndpoints.not().requiresRotation() - .targets(deployment) .groupingBy(Endpoint::cluster) .forEach((clusterId, clusterEndpoints) -> { containerEndpoints.add(new ContainerEndpoint(clusterId.value(), @@ -290,10 +289,8 @@ public class RoutingController { clusterEndpoints.mapToList(Endpoint::dnsName))); }); // Add application endpoints - EndpointList applicationEndpoints = endpoints.scope(Endpoint.Scope.application) - .not().direct() // These are handled by RoutingPolicies - .targets(deployment); - for (var endpoint : applicationEndpoints) { + EndpointList applicationEndpoints = endpoints.scope(Endpoint.Scope.application); + for (var endpoint : applicationEndpoints.shared()) { // DNS for non-shared endpoints is handled by RoutingPolicies Set<ZoneId> targetZones = endpoint.targets().stream() .map(t -> t.deployment().zoneId()) .collect(Collectors.toUnmodifiableSet()); diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/EndpointList.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/EndpointList.java index f626d832b6a..f9fd02fbf56 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/EndpointList.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/EndpointList.java @@ -78,6 +78,11 @@ public class EndpointList extends AbstractFilteringList<Endpoint, EndpointList> return matching(endpoint -> endpoint.routingMethod().isDirect()); } + /** Returns the subset of endpoints that use shared routing */ + public EndpointList shared() { + return matching(endpoint -> endpoint.routingMethod().isShared()); + } + public static EndpointList copyOf(Collection<Endpoint> endpoints) { return new EndpointList(endpoints, false); } |