diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-06-13 16:02:48 +0200 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-06-13 16:03:21 +0200 |
commit | 2b827617d7c8ed1fea0e06b4786c601764bf0b41 (patch) | |
tree | 45cb4f9225d6008d758a06fce39776da32f3d315 | |
parent | 5d9ac8c747ed3a2ce0106fba72e2a13589303630 (diff) |
New endpoints not yet ready
2 files changed, 5 insertions, 5 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java index c1a92ca0abd..23f263ce255 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java @@ -550,13 +550,12 @@ public class ApplicationController { throw new NotExistsException("Deployment", id.toString()); try { - return Optional.of(routingPolicies.get(id)) - .filter(policies -> ! policies.isEmpty()) - .map(policies -> policies.stream() + return Optional.of(routingGenerator.clusterEndpoints(id)) + .filter(endpoints -> ! endpoints.isEmpty()) + .orElseGet(() -> routingPolicies.get(id).stream() .filter(policy -> policy.endpointIn(controller.system()).scope() == Endpoint.Scope.zone) .collect(Collectors.toUnmodifiableMap(policy -> policy.cluster(), - policy -> policy.endpointIn(controller.system()).url()))) - .orElseGet(() -> routingGenerator.clusterEndpoints(id)); + policy -> policy.endpointIn(controller.system()).url()))); } catch (RuntimeException e) { log.log(Level.WARNING, "Failed to get endpoint information for " + id + ": " diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/RoutingPoliciesTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/RoutingPoliciesTest.java index f19c309dd67..449ca509ee4 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/RoutingPoliciesTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/RoutingPoliciesTest.java @@ -202,6 +202,7 @@ public class RoutingPoliciesTest { public void cluster_endpoints_resolve_from_policies() { provisionLoadBalancers(3, app1.id(), zone1); tester.deployCompletely(app1, applicationPackage); + tester.controllerTester().routingGenerator().putEndpoints(new DeploymentId(app1.id(), zone1), Collections.emptyList()); assertEquals(Map.of(ClusterSpec.Id.from("c0"), URI.create("https://c0.app1.tenant1.us-west-1.vespa.oath.cloud/"), ClusterSpec.Id.from("c1"), |