diff options
author | Martin Polden <mpolden@mpolden.no> | 2020-10-30 16:14:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 16:14:28 +0100 |
commit | 964c5024198ad07ce4658d7782cf0103bb467c7d (patch) | |
tree | 06984b3917fdd8b68eb8433ab230193613cfa526 | |
parent | 95942b158ec93be10fa7e83f17ee8ba91506a640 (diff) | |
parent | e24e347a4175c0de62deb321bf70abf2534ef699 (diff) |
Merge pull request #15108 from vespa-engine/mpolden/only-show-global-status
Skip status for routing policies not applying to a global endpoint
2 files changed, 17 insertions, 0 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/routing/RoutingApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/routing/RoutingApiHandler.java index 114a2967e9a..ace176bd91e 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/routing/RoutingApiHandler.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/routing/RoutingApiHandler.java @@ -265,6 +265,7 @@ public class RoutingApiHandler extends AuditLoggingRequestHandler { // Include status from routing policies var routingPolicies = controller.routing().policies().get(deploymentId); for (var policy : routingPolicies.values()) { + if (policy.endpoints().isEmpty()) continue; // This policy does not apply to a global endpoint if (!controller.zoneRegistry().routingMethods(policy.id().zone()).contains(RoutingMethod.exclusive)) continue; deploymentStatusToSlime(deploymentsArray.addObject(), new DeploymentId(policy.id().owner(), policy.id().zone()), diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/routing/RoutingApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/routing/RoutingApiTest.java index b0549662ab0..9bd8485db77 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/routing/RoutingApiTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/routing/RoutingApiTest.java @@ -2,6 +2,7 @@ package com.yahoo.vespa.hosted.controller.restapi.routing; import com.yahoo.application.container.handler.Request; +import com.yahoo.config.application.api.ValidationId; import com.yahoo.config.provision.AthenzDomain; import com.yahoo.config.provision.AthenzService; import com.yahoo.config.provision.zone.RoutingMethod; @@ -184,6 +185,21 @@ public class RoutingApiTest extends ControllerContainerTest { tester.assertResponse(operatorRequest("http://localhost:8080/routing/v1/status/environment/prod/region/us-west-1", "", Request.Method.GET), new File("policy/zone-status-in.json")); + + // Endpoint is removed + applicationPackage = new ApplicationPackageBuilder() + .athenzIdentity(AthenzDomain.from("domain"), AthenzService.from("service")) + .compileVersion(RoutingController.DIRECT_ROUTING_MIN_VERSION) + .region(westZone.region()) + .region(eastZone.region()) + .allow(ValidationId.globalEndpointChange) + .build(); + context.submit(applicationPackage).deploy(); + + // GET deployment status. Now empty as no routing policies have global endpoints + tester.assertResponse(operatorRequest("http://localhost:8080/routing/v1/status/tenant/tenant/application/application/instance/default/environment/prod/region/us-west-1", + "", Request.Method.GET), + "{\"deployments\":[]}"); } @Test |