diff options
author | Martin Polden <mpolden@mpolden.no> | 2023-07-04 10:26:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-04 10:26:39 +0200 |
commit | ecaf9bd3a532ac937895fb7bc861174a583f874b (patch) | |
tree | 93996abc60558f5b686e86de9e6dba0bab325edb | |
parent | 4ccf8b0182224a61aa0d71de89ba71e1066ebc9d (diff) | |
parent | 891d053d99fb5d255c1c74ea0a3ba0671b357b6b (diff) |
Merge pull request #27622 from vespa-engine/mpolden/remove-legacy-name
Remove legacy application endpoint format
5 files changed, 2 insertions, 78 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java index 9621e8ab9eb..5bb73643de5 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java @@ -304,6 +304,7 @@ public class NodesSpecification { default -> 0; // No constraint on other types }; if (resources.diskGb() < minDiskGb) { + // TODO(mpolden): Consider enforcing this on Vespa 9 deployLogger.logApplicationPackage(Level.WARNING, "Requested disk (" + resources.diskGb() + "Gb) in " + clusterId + " is not large enough to fit " + "core/heap dumps. Minimum recommended disk resources " + 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 81362018939..d0b34b6094d 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 @@ -318,10 +318,6 @@ public class RoutingController { new Record(Record.Type.CNAME, RecordName.from(endpoint.dnsName()), RecordData.fqdn(vipHostname)), Priority.normal, Optional.of(application.get().id())); - controller.nameServiceForwarder().removeRecords( - Record.Type.CNAME, RecordName.from(endpoint.legacyRegionalDnsName()), - Priority.normal, - Optional.of(application.get().id())); } Map<ClusterSpec.Id, EndpointList> applicationEndpointsByCluster = applicationEndpoints.groupingBy(Endpoint::cluster); for (var kv : applicationEndpointsByCluster.entrySet()) { 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 1c19810c37e..f55bb0dab6f 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 @@ -40,7 +40,6 @@ public class Endpoint { private final ClusterSpec.Id cluster; private final Optional<InstanceName> instance; private final URI url; - private final URI legacyRegionalUrl; private final List<Target> targets; private final Scope scope; private final boolean legacy; @@ -48,7 +47,7 @@ public class Endpoint { private boolean tokenEndpoint; private Endpoint(TenantAndApplicationId application, Optional<InstanceName> instanceName, EndpointId id, - ClusterSpec.Id cluster, URI url, URI legacyRegionalUrl, List<Target> targets, Scope scope, Port port, boolean legacy, + ClusterSpec.Id cluster, URI url, List<Target> targets, Scope scope, Port port, boolean legacy, RoutingMethod routingMethod, boolean certificateName, boolean tokenEndpoint) { Objects.requireNonNull(application, "application must be non-null"); Objects.requireNonNull(instanceName, "instanceName must be non-null"); @@ -62,7 +61,6 @@ public class Endpoint { this.cluster = requireCluster(cluster, certificateName); this.instance = requireInstance(instanceName, scope); this.url = url; - this.legacyRegionalUrl = legacyRegionalUrl; this.targets = List.copyOf(requireTargets(targets, application, instanceName, scope, certificateName)); this.scope = requireScope(scope, routingMethod); this.legacy = legacy; @@ -102,12 +100,6 @@ public class Endpoint { return url.getAuthority().replaceAll(":.*", ""); } - /** Returns the legacy DNS name with region, for application endpoints */ - public String legacyRegionalDnsName() { - if (scope != Scope.application) throw new IllegalStateException("legacy regional URL is only for application scope endpoints, not " + this); - return legacyRegionalUrl.getAuthority().replaceAll(":.*", ""); - } - /** Returns the target(s) to which this routes traffic */ public List<Target> targets() { return targets; @@ -597,21 +589,11 @@ public class Endpoint { Objects.requireNonNull(system, "system must be non-null"), Objects.requireNonNull(port, "port must be non-null"), false); - URI legacyRegionalUrl = scope != Scope.application ? null - : createUrl(endpointOrClusterAsString(endpointId, cluster), - Objects.requireNonNull(application, "application must be non-null"), - Objects.requireNonNull(instance, "instance must be non-null"), - Objects.requireNonNull(targets, "targets must be non-null"), - Objects.requireNonNull(scope, "scope must be non-null"), - Objects.requireNonNull(system, "system must be non-null"), - Objects.requireNonNull(port, "port must be non-null"), - true); return new Endpoint(application, instance, endpointId, cluster, url, - legacyRegionalUrl, targets, scope, port, diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java index cd632917842..a20d5497945 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/RoutingPolicies.java @@ -336,14 +336,10 @@ public class RoutingPolicies { if (!aliasTargets.isEmpty()) { nameServiceForwarderIn(targetZone).createAlias( RecordName.from(applicationEndpoint.dnsName()), aliasTargets, Priority.normal, owner); - nameServiceForwarderIn(targetZone).removeRecords(Type.ALIAS, RecordName.from(applicationEndpoint.legacyRegionalDnsName()), - Priority.normal, owner); } if (!directTargets.isEmpty()) { nameServiceForwarderIn(targetZone).createDirect( RecordName.from(applicationEndpoint.dnsName()), directTargets, Priority.normal, owner); - nameServiceForwarderIn(targetZone).removeRecords(Type.DIRECT, RecordName.from(applicationEndpoint.legacyRegionalDnsName()), - Priority.normal, owner); } }); @@ -358,12 +354,6 @@ public class RoutingPolicies { target.data(), Priority.normal, owner); - // TODO(mpolden): Remove this and legacy name support in Endpoint after 2023-06-22 - nameServiceForwarderIn(targetZone).removeRecords(target.type(), - RecordName.from(applicationEndpoint.legacyRegionalDnsName()), - target.data(), - Priority.normal, - owner); }); }); } @@ -528,22 +518,12 @@ public class RoutingPolicies { RecordData.fqdn(policy.canonicalName().get().value()), Priority.normal, ownerOf(allocation)); - forwarder.removeRecords(Record.Type.ALIAS, - RecordName.from(endpoint.legacyRegionalDnsName()), - RecordData.fqdn(policy.canonicalName().get().value()), - Priority.normal, - ownerOf(allocation)); } else { forwarder.removeRecords(Record.Type.DIRECT, RecordName.from(endpoint.dnsName()), RecordData.from(policy.ipAddress().get()), Priority.normal, ownerOf(allocation)); - forwarder.removeRecords(Record.Type.DIRECT, - RecordName.from(endpoint.legacyRegionalDnsName()), - RecordData.from(policy.ipAddress().get()), - Priority.normal, - ownerOf(allocation)); } } } 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 ca31ceebc17..dc96aa6c62c 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 @@ -277,41 +277,6 @@ public class EndpointTest { } @Test - void application_endpoints_legacy_dns_names() { - Map<String, Endpoint> tests = Map.of( - "weighted.a1.t1.us-west-1.r.vespa-app.cloud", - Endpoint.of(app1) - .targetApplication(EndpointId.of("weighted"), ClusterSpec.Id.from("qrs"), - Map.of(new DeploymentId(app1.instance("i1"), ZoneId.from("prod", "us-west-1")), 1)) - .routingMethod(RoutingMethod.exclusive) - .on(Port.tls()) - .in(SystemName.Public), - "weighted.a1.t1.us-west-1.r.cd.vespa-app.cloud", - Endpoint.of(app1) - .targetApplication(EndpointId.of("weighted"), ClusterSpec.Id.from("qrs"), - Map.of(new DeploymentId(app1.instance("i1"), ZoneId.from("prod", "us-west-1")), 1)) - .routingMethod(RoutingMethod.exclusive) - .on(Port.tls()) - .in(SystemName.PublicCd), - "a2.t2.us-east-3-r.vespa.oath.cloud", - Endpoint.of(app2) - .targetApplication(EndpointId.defaultId(), ClusterSpec.Id.from("qrs"), - Map.of(new DeploymentId(app2.instance("i1"), ZoneId.from("prod", "us-east-3")), 1)) - .routingMethod(RoutingMethod.exclusive) - .on(Port.tls()) - .in(SystemName.main), - "cd.a2.t2.us-east-3-r.cd.vespa.oath.cloud", - Endpoint.of(app2) - .targetApplication(EndpointId.defaultId(), ClusterSpec.Id.from("qrs"), - Map.of(new DeploymentId(app2.instance("i1"), ZoneId.from("prod", "us-east-3")), 1)) - .routingMethod(RoutingMethod.exclusive) - .on(Port.tls()) - .in(SystemName.cd) - ); - tests.forEach((expected, endpoint) -> assertEquals(expected, endpoint.legacyRegionalDnsName())); - } - - @Test void application_endpoints() { Map<String, Endpoint> tests = Map.of( "https://weighted.a1.t1.a.vespa-app.cloud/", |