diff options
7 files changed, 12 insertions, 61 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 943d6ac7b18..daf9cfd428f 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 @@ -441,16 +441,10 @@ public class RoutingController { .on(Port.fromRoutingMethod(method)) .routingMethod(method) .in(controller.system())); - // Add legacy endpoints + // Add legacy endpoint if (legacyNamesAvailable && method == RoutingMethod.shared) { endpoints.add(Endpoint.of(routingId.instance()) .target(routingId.endpointId(), cluster, deployments) - .on(Port.plain(4080)) - .legacy() - .routingMethod(method) - .in(controller.system())); - endpoints.add(Endpoint.of(routingId.instance()) - .target(routingId.endpointId(), cluster, deployments) .on(Port.tls(4443)) .legacy() .routingMethod(method) 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 8f37d287c1a..262730558d0 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 @@ -42,7 +42,6 @@ public class Endpoint { private final Scope scope; private final boolean legacy; private final RoutingMethod routingMethod; - private final boolean tls; private Endpoint(TenantAndApplicationId application, Optional<InstanceName> instanceName, EndpointId id, ClusterSpec.Id cluster, URI url, List<Target> targets, Scope scope, Port port, boolean legacy, @@ -63,7 +62,6 @@ public class Endpoint { this.scope = requireScope(scope, routingMethod); this.legacy = legacy; this.routingMethod = routingMethod; - this.tls = port.tls; } /** @@ -125,7 +123,7 @@ public class Endpoint { /** Returns whether this endpoint supports TLS connections */ public boolean tls() { - return tls; + return true; } /** Returns whether this requires a rotation to be reachable */ @@ -164,10 +162,9 @@ public class Endpoint { private static URI createUrl(String name, TenantAndApplicationId application, Optional<InstanceName> instance, List<Target> targets, Scope scope, SystemName system, Port port, boolean legacy, RoutingMethod routingMethod) { - String scheme = port.tls ? "https" : "http"; - String separator = separator(system, routingMethod, port.tls); + String separator = separator(system, routingMethod); String portPart = port.isDefault() ? "" : ":" + port.port; - return URI.create(scheme + "://" + + return URI.create("https://" + sanitize(namePart(name, separator)) + systemPart(system, separator) + sanitize(instancePart(instance, separator)) + @@ -185,8 +182,7 @@ public class Endpoint { return part.replace('_', '-'); } - private static String separator(SystemName system, RoutingMethod routingMethod, boolean tls) { - if (!tls) return "."; + private static String separator(SystemName system, RoutingMethod routingMethod) { if (routingMethod.isDirect()) return "."; if (system.isPublic()) return "."; return "--"; @@ -390,21 +386,19 @@ public class Endpoint { /** Represents an endpoint's HTTP port */ public static class Port { - private static final Port TLS_DEFAULT = new Port(443, true); + private static final Port TLS_DEFAULT = new Port(443); private final int port; - private final boolean tls; - private Port(int port, boolean tls) { + private Port(int port) { if (port < 1 || port > 65535) { throw new IllegalArgumentException("Port must be between 1 and 65535, got " + port); } this.port = port; - this.tls = tls; } private boolean isDefault() { - return port == 80 || port == 443; + return port == 443; } /** Returns the default HTTPS port */ @@ -420,12 +414,7 @@ public class Endpoint { /** Create a HTTPS port */ public static Port tls(int port) { - return new Port(port, true); - } - - /** Create a HTTP port */ - public static Port plain(int port) { - return new Port(port, false); + return new Port(port); } } 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 be8e49cf661..9f6f7e4dd5c 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 @@ -96,13 +96,9 @@ public class RoutingPolicy { DeploymentId deployment = new DeploymentId(id.owner(), id.zone()); List<Endpoint> endpoints = new ArrayList<>(); endpoints.add(endpoint(routingMethod).target(id.cluster(), deployment).in(system)); - // Add legacy endpoints + // Add legacy endpoint if (routingMethod == RoutingMethod.shared) { endpoints.add(endpoint(routingMethod).target(id.cluster(), deployment) - .on(Port.plain(4080)) - .legacy() - .in(system)); - endpoints.add(endpoint(routingMethod).target(id.cluster(), deployment) .on(Port.tls(4443)) .legacy() .in(system)); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java index 1215ddbc2ad..ce8c981fb5b 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java @@ -334,12 +334,11 @@ public class ControllerTest { assertEquals("Rotation names are passed to config server in " + deployment.zone(), Set.of("rotation-id-01", "app1--tenant1.global.vespa.oath.cloud", - "app1.tenant1.global.vespa.yahooapis.com", "app1--tenant1.global.vespa.yahooapis.com"), tester.configServer().containerEndpointNames(context.deploymentIdIn(deployment.zone()))); } context.flushDnsUpdates(); - assertEquals(3, tester.controllerTester().nameService().records().size()); + assertEquals(2, tester.controllerTester().nameService().records().size()); Optional<Record> record = tester.controllerTester().findCname("app1--tenant1.global.vespa.yahooapis.com"); assertTrue(record.isPresent()); @@ -351,16 +350,10 @@ public class ControllerTest { assertEquals("app1--tenant1.global.vespa.oath.cloud", record.get().name().asString()); assertEquals("rotation-fqdn-01.", record.get().data().asString()); - record = tester.controllerTester().findCname("app1.tenant1.global.vespa.yahooapis.com"); - assertTrue(record.isPresent()); - assertEquals("app1.tenant1.global.vespa.yahooapis.com", record.get().name().asString()); - assertEquals("rotation-fqdn-01.", record.get().data().asString()); - List<String> globalDnsNames = tester.controller().routing().readDeclaredEndpointsOf(context.instanceId()) .scope(Endpoint.Scope.global) .mapToList(Endpoint::dnsName); assertEquals(List.of("app1--tenant1.global.vespa.oath.cloud", - "app1.tenant1.global.vespa.yahooapis.com", "app1--tenant1.global.vespa.yahooapis.com"), globalDnsNames); } @@ -1028,7 +1021,6 @@ public class ControllerTest { .scope(Endpoint.Scope.zone) .mapToList(Endpoint::dnsName); assertEquals(List.of("application--tenant.us-west-1.vespa.oath.cloud", - "application.tenant.us-west-1.prod.vespa.yahooapis.com", "application--tenant.us-west-1.prod.vespa.yahooapis.com", "application.tenant.us-west-1.vespa.oath.cloud"), zoneDnsNames); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/EndpointTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/EndpointTest.java index e50c32d0e5d..8e6618dc1a7 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/EndpointTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/EndpointTest.java @@ -33,10 +33,6 @@ public class EndpointTest { EndpointId endpointId = EndpointId.defaultId(); Map<String, Endpoint> tests = Map.of( - // Legacy endpoint - "http://a1.t1.global.vespa.yahooapis.com:4080/", - Endpoint.of(instance1).target(endpointId, cluster, List.of(deployment1)).on(Port.plain(4080)).legacy().in(SystemName.main), - // Legacy endpoint with TLS "https://a1--t1.global.vespa.yahooapis.com:4443/", Endpoint.of(instance1).target(endpointId, cluster, List.of(deployment1)).on(Port.tls(4443)).legacy().in(SystemName.main), @@ -99,10 +95,6 @@ public class EndpointTest { EndpointId endpointId = EndpointId.defaultId(); Map<String, Endpoint> tests = Map.of( - // Legacy endpoint - "http://a1.t1.global.vespa.yahooapis.com:4080/", - Endpoint.of(instance1).target(endpointId, cluster, List.of(deployment1)).on(Port.plain(4080)).legacy().in(SystemName.main), - // Legacy endpoint with TLS "https://a1--t1.global.vespa.yahooapis.com:4443/", Endpoint.of(instance1).target(endpointId, cluster, List.of(deployment1)).on(Port.tls(4443)).legacy().in(SystemName.main), @@ -161,10 +153,6 @@ public class EndpointTest { var testZone = new DeploymentId(instance1, ZoneId.from("test", "us-north-2")); Map<String, Endpoint> tests = Map.of( - // Legacy endpoint (always contains environment) - "http://a1.t1.us-north-1.prod.vespa.yahooapis.com:4080/", - Endpoint.of(instance1).target(cluster, prodZone).on(Port.plain(4080)).legacy().in(SystemName.main), - // Secure legacy endpoint "https://a1--t1.us-north-1.prod.vespa.yahooapis.com:4443/", Endpoint.of(instance1).target(cluster, prodZone).on(Port.tls(4443)).legacy().in(SystemName.main), diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/MetricsReporterTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/MetricsReporterTest.java index d97f1d58043..581ec68b3dd 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/MetricsReporterTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/MetricsReporterTest.java @@ -283,7 +283,7 @@ public class MetricsReporterTest { context.submit(applicationPackage).deploy(); reporter.maintain(); - assertEquals("Deployment queues name services requests", 6, metrics.getMetric(MetricsReporter.NAME_SERVICE_REQUESTS_QUEUED).intValue()); + assertEquals("Deployment queues name services requests", 4, metrics.getMetric(MetricsReporter.NAME_SERVICE_REQUESTS_QUEUED).intValue()); context.flushDnsUpdates(); reporter.maintain(); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-with-routing-policy-legacy.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-with-routing-policy-legacy.json index eb508b2459e..4955c549b4b 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-with-routing-policy-legacy.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment-with-routing-policy-legacy.json @@ -23,14 +23,6 @@ }, { "cluster": "default", - "tls": false, - "url": "http://instance1.application1.tenant1.us-west-1.prod.vespa.yahooapis.com:4080/", - "scope": "zone", - "routingMethod": "shared", - "legacy": true - }, - { - "cluster": "default", "tls": true, "url": "https://instance1--application1--tenant1.us-west-1.prod.vespa.yahooapis.com:4443/", "scope": "zone", |