summaryrefslogtreecommitdiffstats
path: root/controller-server/src
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2022-06-09 14:15:31 +0200
committerMartin Polden <mpolden@mpolden.no>2022-06-09 14:15:31 +0200
commit160ad95be2714a7f91ac0f4c5d0f1146222ab845 (patch)
treed4ca6cd1603814f43c3f243ea6af52a28299e179 /controller-server/src
parent66d68781f9d8f3fee557514559f329a9070c10b3 (diff)
Remove unused SystemApplication endpoint handling
Diffstat (limited to 'controller-server/src')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/Endpoint.java14
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java12
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicy.java6
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesTest.java18
4 files changed, 0 insertions, 50 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/Endpoint.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/Endpoint.java
index 8de72893a7c..e214c05b669 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/Endpoint.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/Endpoint.java
@@ -422,20 +422,6 @@ public class Endpoint {
return new EndpointBuilder(application, Optional.empty());
}
- /** Create an endpoint for given system application */
- public static Endpoint of(SystemApplication systemApplication, ZoneId zone, URI url) {
- if (!systemApplication.hasEndpoint()) throw new IllegalArgumentException(systemApplication + " has no endpoint");
- RoutingMethod routingMethod = RoutingMethod.exclusive;
- Port port = url.getPort() == -1 ? Port.tls() : Port.tls(url.getPort()); // System application endpoints are always TLS
- return new Endpoint(TenantAndApplicationId.from(systemApplication.id()),
- Optional.of(systemApplication.id().instance()),
- null,
- ClusterSpec.Id.from("admin"),
- url,
- List.of(new Target(new DeploymentId(systemApplication.id(), zone))),
- Scope.zone, port, false, routingMethod, false);
- }
-
/** A target of an endpoint */
public static class Target {
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java
index 613422b2749..f4a1001d9ff 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/SystemApplication.java
@@ -11,7 +11,6 @@ import com.yahoo.vespa.applicationmodel.InfrastructureApplication;
import com.yahoo.vespa.hosted.controller.Controller;
import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId;
import com.yahoo.vespa.hosted.controller.api.integration.configserver.ServiceConvergence;
-import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneRegistry;
import java.util.Arrays;
import java.util.EnumSet;
@@ -76,17 +75,6 @@ public enum SystemApplication {
return nodeType().isHost();
}
- /** Returns whether this has an endpoint */
- public boolean hasEndpoint() {
- return this == configServer;
- }
-
- /** Returns the endpoint of this, if any */
- public Optional<Endpoint> endpointIn(ZoneId zone, ZoneRegistry zoneRegistry) {
- if (!hasEndpoint()) return Optional.empty();
- return Optional.of(Endpoint.of(this, zone, zoneRegistry.getConfigServerVipUri(zone)));
- }
-
/** All system applications that are not the controller */
public static List<SystemApplication> notController() {
return List.copyOf(EnumSet.complementOf(EnumSet.of(SystemApplication.controllerHost)));
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicy.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicy.java
index 1ccb3205816..fa6741ec8b8 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicy.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicy.java
@@ -11,7 +11,6 @@ import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneRegistry;
import com.yahoo.vespa.hosted.controller.application.Endpoint;
import com.yahoo.vespa.hosted.controller.application.Endpoint.Port;
import com.yahoo.vespa.hosted.controller.application.EndpointId;
-import com.yahoo.vespa.hosted.controller.application.SystemApplication;
import java.util.List;
import java.util.Objects;
@@ -87,11 +86,6 @@ public class RoutingPolicy {
/** Returns the zone endpoints of this */
public List<Endpoint> zoneEndpointsIn(SystemName system, RoutingMethod routingMethod, ZoneRegistry zoneRegistry) {
- Optional<Endpoint> infraEndpoint = SystemApplication.matching(id.owner())
- .flatMap(app -> app.endpointIn(id.zone(), zoneRegistry));
- if (infraEndpoint.isPresent()) {
- return List.of(infraEndpoint.get());
- }
DeploymentId deployment = new DeploymentId(id.owner(), id.zone());
return List.of(endpoint(routingMethod).target(id.cluster(), deployment).in(system));
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesTest.java
index 303230b91ad..c0fb9b3d8c7 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/RoutingPoliciesTest.java
@@ -25,14 +25,12 @@ import com.yahoo.vespa.hosted.controller.api.integration.dns.RecordName;
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.SystemApplication;
import com.yahoo.vespa.hosted.controller.application.TenantAndApplicationId;
import com.yahoo.vespa.hosted.controller.application.pkg.ApplicationPackage;
import com.yahoo.vespa.hosted.controller.deployment.ApplicationPackageBuilder;
import com.yahoo.vespa.hosted.controller.deployment.DeploymentContext;
import com.yahoo.vespa.hosted.controller.deployment.DeploymentTester;
import com.yahoo.vespa.hosted.controller.integration.ZoneApiMock;
-import com.yahoo.vespa.hosted.controller.maintenance.NameServiceDispatcher;
import com.yahoo.vespa.hosted.rotation.config.RotationsConfig;
import org.junit.Test;
@@ -693,22 +691,6 @@ public class RoutingPoliciesTest {
}
@Test
- public void config_server_routing_policy() {
- var tester = new RoutingPoliciesTester();
- var app = SystemApplication.configServer.id();
- RecordName name = RecordName.from("cfg.prod.us-west-1.test.vip");
-
- tester.provisionLoadBalancers(1, app, zone1);
- tester.routingPolicies().refresh(new DeploymentId(app, zone1), DeploymentSpec.empty);
- new NameServiceDispatcher(tester.tester.controller(), Duration.ofSeconds(Integer.MAX_VALUE)).run();
-
- List<Record> records = tester.controllerTester().nameService().findRecords(Record.Type.CNAME, name);
- assertEquals(1, records.size());
- assertEquals(RecordData.from("lb-0--hosted-vespa.zone-config-servers.default--prod.us-west-1."),
- records.get(0).data());
- }
-
- @Test
public void application_endpoint_routing_policy() {
RoutingPoliciesTester tester = new RoutingPoliciesTester();
TenantAndApplicationId application = TenantAndApplicationId.from("tenant1", "app1");