diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2019-06-14 14:02:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-14 14:02:04 +0200 |
commit | a3c43101c7ed2cfe152e5a3222958974e0499e47 (patch) | |
tree | e9614edc0ab359cdfa7ac57b26c76bacfc141329 /controller-server | |
parent | 9149dd7cd042a9648994c1923ac879f3a4b3b1b5 (diff) | |
parent | 88ef55cb45e9998df62bf8f76b0244861b6f4e9a (diff) |
Merge pull request #9801 from vespa-engine/jvenstad/tenant-cd
Jvenstad/tenant cd
Diffstat (limited to 'controller-server')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java | 18 |
1 files changed, 9 insertions, 9 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 9edff876fb4..7e2b04c5a79 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 @@ -548,19 +548,19 @@ public class ApplicationController { .orElse(id.applicationId().instance().isTester())) throw new NotExistsException("Deployment", id.toString()); + // TODO jvenstad: Swap to use routingPolicies first, when this is ready. try { - 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()))); + var endpoints = routingGenerator.clusterEndpoints(id); + if ( ! endpoints.isEmpty()) + return endpoints; } catch (RuntimeException e) { - log.log(Level.WARNING, "Failed to get endpoint information for " + id + ": " - + Exceptions.toMessageString(e)); - return Collections.emptyMap(); + log.log(Level.WARNING, "Failed to get endpoint information for " + id + ": " + Exceptions.toMessageString(e)); } + return 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())); } /** Returns all zone-specific cluster endpoints for the given application, in the given zones. */ |