summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2022-02-14 11:15:22 +0100
committerMartin Polden <mpolden@mpolden.no>2022-02-14 11:15:22 +0100
commit9473505a44c039d1739b54fb02d790b8fca073f4 (patch)
treeb373df8843df3e359aa585e539a528d34f8802ad /controller-server
parent6f158624fb44f31df8b28e3e04be7af9854ca205 (diff)
Stop using shared routing method in tests
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java188
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java12
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/MetricsReporterTest.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java3
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment.json16
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-us-central-1.json18
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/system-test-details.json4
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config-dev.json4
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config.json4
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/routing/responses/endpoint/endpoints.json27
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepositoryTest.java4
12 files changed, 99 insertions, 185 deletions
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 8ed09bfdf8a..63c0193ba7f 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
@@ -53,7 +53,6 @@ import java.util.Optional;
import java.util.OptionalInt;
import java.util.Set;
import java.util.function.Function;
-import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -238,14 +237,12 @@ public class ControllerTest {
ZoneId usWest = ZoneId.from("prod.us-west-1");
ZoneId usCentral = ZoneId.from("prod.us-central-1");
ApplicationPackage applicationPackage = new ApplicationPackageBuilder()
- .athenzIdentity(AthenzDomain.from("domain"), AthenzService.from("service"))
.instances("beta,default")
.endpoint("default", "foo")
.region(usWest.region())
.region(usCentral.region()) // Two deployments should result in each DNS alias being registered once
.build();
tester.controllerTester().zoneRegistry().setRoutingMethod(List.of(ZoneApiMock.from(usWest), ZoneApiMock.from(usCentral)),
- RoutingMethod.shared,
RoutingMethod.sharedLayer4);
betaContext.submit(applicationPackage).deploy();
@@ -254,12 +251,6 @@ public class ControllerTest {
assertFalse(betaDeployments.isEmpty());
Set<ContainerEndpoint> containerEndpoints = Set.of(new ContainerEndpoint("foo",
"global",
- List.of("beta--app1--tenant1.global.vespa.oath.cloud",
- "rotation-id-01"),
- OptionalInt.empty(),
- RoutingMethod.shared),
- new ContainerEndpoint("foo",
- "global",
List.of("beta.app1.tenant1.global.vespa.oath.cloud",
"rotation-id-01"),
OptionalInt.empty(),
@@ -278,12 +269,6 @@ public class ControllerTest {
assertFalse(defaultDeployments.isEmpty());
Set<ContainerEndpoint> containerEndpoints = Set.of(new ContainerEndpoint("foo",
"global",
- List.of("app1--tenant1.global.vespa.oath.cloud",
- "rotation-id-02"),
- OptionalInt.empty(),
- RoutingMethod.shared),
- new ContainerEndpoint("foo",
- "global",
List.of("app1.tenant1.global.vespa.oath.cloud",
"rotation-id-02"),
OptionalInt.empty(),
@@ -295,8 +280,8 @@ public class ControllerTest {
defaultContext.flushDnsUpdates();
}
- Map<String, String> rotationCnames = Map.of("beta--app1--tenant1.global.vespa.oath.cloud", "rotation-fqdn-01.",
- "app1--tenant1.global.vespa.oath.cloud", "rotation-fqdn-02.");
+ Map<String, String> rotationCnames = Map.of("beta.app1.tenant1.global.vespa.oath.cloud", "rotation-fqdn-01.",
+ "app1.tenant1.global.vespa.oath.cloud", "rotation-fqdn-02.");
rotationCnames.forEach((cname, data) -> {
var record = tester.controllerTester().findCname(cname);
assertTrue(record.isPresent());
@@ -304,10 +289,8 @@ public class ControllerTest {
assertEquals(data, record.get().data().asString());
});
- Map<ApplicationId, Set<String>> globalDnsNamesByInstance = Map.of(betaContext.instanceId(), Set.of("beta--app1--tenant1.global.vespa.oath.cloud",
- "beta.app1.tenant1.global.vespa.oath.cloud"),
- defaultContext.instanceId(), Set.of("app1--tenant1.global.vespa.oath.cloud",
- "app1.tenant1.global.vespa.oath.cloud"));
+ Map<ApplicationId, Set<String>> globalDnsNamesByInstance = Map.of(betaContext.instanceId(), Set.of("beta.app1.tenant1.global.vespa.oath.cloud"),
+ defaultContext.instanceId(), Set.of("app1.tenant1.global.vespa.oath.cloud"));
globalDnsNamesByInstance.forEach((instance, dnsNames) -> {
Set<String> actualDnsNames = tester.controller().routing().readDeclaredEndpointsOf(instance)
@@ -334,31 +317,22 @@ public class ControllerTest {
for (Deployment deployment : deployments) {
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.oath.cloud",
- "app1--tenant1.global.vespa.yahooapis.com"),
+ "app1.tenant1.global.vespa.oath.cloud"),
tester.configServer().containerEndpointNames(context.deploymentIdIn(deployment.zone())));
}
context.flushDnsUpdates();
- assertEquals(3, tester.controllerTester().nameService().records().size());
-
- Optional<Record> 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());
+ assertEquals(1, tester.controllerTester().nameService().records().size());
- record = tester.controllerTester().findCname("app1--tenant1.global.vespa.oath.cloud");
+ Optional<Record> record = tester.controllerTester().findCname("app1.tenant1.global.vespa.oath.cloud");
assertTrue(record.isPresent());
- assertEquals("app1--tenant1.global.vespa.oath.cloud", record.get().name().asString());
+ assertEquals("app1.tenant1.global.vespa.oath.cloud", 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)
.sortedBy(Comparator.comparing(Endpoint::dnsName))
.mapToList(Endpoint::dnsName);
- assertEquals(List.of("app1--tenant1.global.vespa.oath.cloud",
- "app1--tenant1.global.vespa.yahooapis.com",
- "app1.tenant1.global.vespa.oath.cloud"),
+ assertEquals(List.of("app1.tenant1.global.vespa.oath.cloud"),
globalDnsNames);
}
@@ -379,11 +353,11 @@ public class ControllerTest {
assertFalse(deployments.isEmpty());
var notWest = Set.of(
- "rotation-id-01", "foobar--app1--tenant1.global.vespa.oath.cloud", "foobar.app1.tenant1.global.vespa.oath.cloud",
- "rotation-id-02", "app1--tenant1.global.vespa.oath.cloud", "app1.tenant1.global.vespa.oath.cloud",
- "rotation-id-03", "all--app1--tenant1.global.vespa.oath.cloud", "all.app1.tenant1.global.vespa.oath.cloud"
+ "rotation-id-01", "foobar.app1.tenant1.global.vespa.oath.cloud",
+ "rotation-id-02", "app1.tenant1.global.vespa.oath.cloud",
+ "rotation-id-03", "all.app1.tenant1.global.vespa.oath.cloud"
);
- var west = Sets.union(notWest, Set.of("rotation-id-04", "west--app1--tenant1.global.vespa.oath.cloud", "west.app1.tenant1.global.vespa.oath.cloud"));
+ var west = Sets.union(notWest, Set.of("rotation-id-04", "west.app1.tenant1.global.vespa.oath.cloud"));
for (Deployment deployment : deployments) {
assertEquals("Rotation names are passed to config server in " + deployment.zone(),
@@ -392,26 +366,26 @@ public class ControllerTest {
}
context.flushDnsUpdates();
- assertEquals(8, tester.controllerTester().nameService().records().size());
+ assertEquals(4, tester.controllerTester().nameService().records().size());
- var record1 = tester.controllerTester().findCname("app1--tenant1.global.vespa.oath.cloud");
+ var record1 = tester.controllerTester().findCname("app1.tenant1.global.vespa.oath.cloud");
assertTrue(record1.isPresent());
- assertEquals("app1--tenant1.global.vespa.oath.cloud", record1.get().name().asString());
+ assertEquals("app1.tenant1.global.vespa.oath.cloud", record1.get().name().asString());
assertEquals("rotation-fqdn-02.", record1.get().data().asString());
- var record2 = tester.controllerTester().findCname("foobar--app1--tenant1.global.vespa.oath.cloud");
+ var record2 = tester.controllerTester().findCname("foobar.app1.tenant1.global.vespa.oath.cloud");
assertTrue(record2.isPresent());
- assertEquals("foobar--app1--tenant1.global.vespa.oath.cloud", record2.get().name().asString());
+ assertEquals("foobar.app1.tenant1.global.vespa.oath.cloud", record2.get().name().asString());
assertEquals("rotation-fqdn-01.", record2.get().data().asString());
- var record3 = tester.controllerTester().findCname("all--app1--tenant1.global.vespa.oath.cloud");
+ var record3 = tester.controllerTester().findCname("all.app1.tenant1.global.vespa.oath.cloud");
assertTrue(record3.isPresent());
- assertEquals("all--app1--tenant1.global.vespa.oath.cloud", record3.get().name().asString());
+ assertEquals("all.app1.tenant1.global.vespa.oath.cloud", record3.get().name().asString());
assertEquals("rotation-fqdn-03.", record3.get().data().asString());
- var record4 = tester.controllerTester().findCname("west--app1--tenant1.global.vespa.oath.cloud");
+ var record4 = tester.controllerTester().findCname("west.app1.tenant1.global.vespa.oath.cloud");
assertTrue(record4.isPresent());
- assertEquals("west--app1--tenant1.global.vespa.oath.cloud", record4.get().name().asString());
+ assertEquals("west.app1.tenant1.global.vespa.oath.cloud", record4.get().name().asString());
assertEquals("rotation-fqdn-04.", record4.get().data().asString());
}
@@ -434,7 +408,7 @@ public class ControllerTest {
for (var zone : List.of(west, central)) {
assertEquals(
"Zone " + zone + " is a member of global endpoint",
- Set.of("rotation-id-01", "app1--tenant1.global.vespa.oath.cloud", "app1.tenant1.global.vespa.oath.cloud"),
+ Set.of("rotation-id-01", "app1.tenant1.global.vespa.oath.cloud"),
tester.configServer().containerEndpointNames(context.deploymentIdIn(zone))
);
}
@@ -452,13 +426,13 @@ public class ControllerTest {
for (var zone : List.of(west, central)) {
assertEquals(
"Zone " + zone + " is a member of global endpoint",
- Set.of("rotation-id-01", "app1--tenant1.global.vespa.oath.cloud", "app1.tenant1.global.vespa.oath.cloud"),
+ Set.of("rotation-id-01", "app1.tenant1.global.vespa.oath.cloud"),
tester.configServer().containerEndpointNames(context.deploymentIdIn(zone))
);
}
assertEquals(
"Zone " + east + " is a member of global endpoint",
- Set.of("rotation-id-02", "east--app1--tenant1.global.vespa.oath.cloud", "east.app1.tenant1.global.vespa.oath.cloud"),
+ Set.of("rotation-id-02", "east.app1.tenant1.global.vespa.oath.cloud"),
tester.configServer().containerEndpointNames(context.deploymentIdIn(east))
);
@@ -475,9 +449,9 @@ public class ControllerTest {
assertEquals(
"Zone " + zone + " is a member of global endpoint",
zone.equals(east)
- ? Set.of("rotation-id-01", "app1--tenant1.global.vespa.oath.cloud", "app1.tenant1.global.vespa.oath.cloud",
- "rotation-id-02", "east--app1--tenant1.global.vespa.oath.cloud", "east.app1.tenant1.global.vespa.oath.cloud")
- : Set.of("rotation-id-01", "app1--tenant1.global.vespa.oath.cloud", "app1.tenant1.global.vespa.oath.cloud"),
+ ? Set.of("rotation-id-01", "app1.tenant1.global.vespa.oath.cloud",
+ "rotation-id-02", "east.app1.tenant1.global.vespa.oath.cloud")
+ : Set.of("rotation-id-01", "app1.tenant1.global.vespa.oath.cloud"),
tester.configServer().containerEndpointNames(context.deploymentIdIn(zone))
);
}
@@ -560,6 +534,7 @@ public class ControllerTest {
@Test
public void testDnsUpdatesWithChangeInRotationAssignment() {
// Application 1 is deployed and deleted
+ String dnsName1 = "app1.tenant1.global.vespa.oath.cloud";
{
var context = tester.newDeploymentContext("tenant1", "app1", "default");
ApplicationPackage applicationPackage = new ApplicationPackageBuilder()
@@ -569,12 +544,11 @@ public class ControllerTest {
.build();
context.submit(applicationPackage).deploy();
- assertEquals(2, tester.controllerTester().nameService().records().size());
-
+ assertEquals(1, tester.controllerTester().nameService().records().size());
{
- Optional<Record> record = tester.controllerTester().findCname("app1--tenant1.global.vespa.oath.cloud");
+ Optional<Record> record = tester.controllerTester().findCname(dnsName1);
assertTrue(record.isPresent());
- assertEquals("app1--tenant1.global.vespa.oath.cloud", record.get().name().asString());
+ assertEquals(dnsName1, record.get().name().asString());
assertEquals("rotation-fqdn-01.", record.get().data().asString());
}
@@ -593,17 +567,13 @@ public class ControllerTest {
}
context.flushDnsUpdates();
- // Records are removed
- List<String> removed = List.of("app1--tenant1.global.vespa.yahooapis.com",
- "app1--tenant1.global.vespa.oath.cloud",
- "app1.tenant1.global.vespa.yahooapis.com");
- for (var name : removed) {
- Optional<Record> record = tester.controllerTester().findCname(name);
- assertTrue(name + " is removed", record.isEmpty());
- }
+ // Record is removed
+ Optional<Record> record = tester.controllerTester().findCname(dnsName1);
+ assertTrue(dnsName1 + " is removed", record.isEmpty());
}
// Application 2 is deployed and assigned same rotation as application 1 had before deletion
+ String dnsName2 = "app2.tenant2.global.vespa.oath.cloud";
{
var context = tester.newDeploymentContext("tenant2", "app2", "default");
ApplicationPackage applicationPackage = new ApplicationPackageBuilder()
@@ -612,11 +582,11 @@ public class ControllerTest {
.region("us-central-1")
.build();
context.submit(applicationPackage).deploy();
- assertEquals(2, tester.controllerTester().nameService().records().size());
+ assertEquals(1, tester.controllerTester().nameService().records().size());
- var record = tester.controllerTester().findCname("app2--tenant2.global.vespa.oath.cloud");
+ var record = tester.controllerTester().findCname(dnsName2);
assertTrue(record.isPresent());
- assertEquals("app2--tenant2.global.vespa.oath.cloud", record.get().name().asString());
+ assertEquals(dnsName2, record.get().name().asString());
assertEquals("rotation-fqdn-01.", record.get().data().asString());
}
@@ -632,13 +602,13 @@ public class ControllerTest {
assertEquals("rotation-id-02", context.instance().rotations().get(0).rotationId().asString());
// DNS records are created for the newly assigned rotation
- assertEquals(4, tester.controllerTester().nameService().records().size());
+ assertEquals(2, tester.controllerTester().nameService().records().size());
- var record1 = tester.controllerTester().findCname("app1--tenant1.global.vespa.oath.cloud");
+ var record1 = tester.controllerTester().findCname(dnsName1);
assertTrue(record1.isPresent());
assertEquals("rotation-fqdn-02.", record1.get().data().asString());
- var record2 = tester.controllerTester().findCname("app2--tenant2.global.vespa.oath.cloud");
+ var record2 = tester.controllerTester().findCname(dnsName2);
assertTrue(record2.isPresent());
assertEquals("rotation-fqdn-01.", record2.get().data().asString());
}
@@ -719,7 +689,7 @@ public class ControllerTest {
var context = tester.newDeploymentContext();
ZoneId zone = ZoneId.from("dev", "us-east-1");
tester.controllerTester().zoneRegistry()
- .setRoutingMethod(ZoneApiMock.from(zone), RoutingMethod.shared, RoutingMethod.sharedLayer4);
+ .setRoutingMethod(ZoneApiMock.from(zone), RoutingMethod.sharedLayer4);
// Deploy
context.runJob(zone, applicationPackage);
@@ -735,7 +705,7 @@ public class ControllerTest {
.stream()
.map(Endpoint::routingMethod)
.collect(Collectors.toSet());
- assertEquals(routingMethods, Set.of(RoutingMethod.shared, RoutingMethod.sharedLayer4));
+ assertEquals(routingMethods, Set.of(RoutingMethod.sharedLayer4));
// Deployment has stored application meta.
assertNotNull(tester.controllerTester().serviceRegistry().applicationStore()
@@ -775,12 +745,11 @@ public class ControllerTest {
public void testDeletingApplicationThatHasAlreadyBeenDeleted() {
var context = tester.newDeploymentContext();
ApplicationPackage applicationPackage = new ApplicationPackageBuilder()
- .region("us-east-3")
.region("us-west-1")
.build();
ZoneId zone = ZoneId.from(Environment.prod, RegionName.from("us-west-1"));
- context.runJob(zone, applicationPackage);
+ context.submit(applicationPackage).runJob(zone, applicationPackage);
tester.controller().applications().deactivate(context.instanceId(), zone);
tester.controller().applications().deactivate(context.instanceId(), zone);
}
@@ -911,12 +880,10 @@ public class ControllerTest {
.region(zone2.region())
.build();
- // Zone 1 supports shared and sharedLayer4
- tester.controllerTester().zoneRegistry().setRoutingMethod(ZoneApiMock.from(zone1), RoutingMethod.shared,
- RoutingMethod.sharedLayer4);
+ // Zone 1 supports sharedLayer4
+ tester.controllerTester().zoneRegistry().setRoutingMethod(ZoneApiMock.from(zone1), RoutingMethod.sharedLayer4);
// Zone 2 supports shared and exclusive
- tester.controllerTester().zoneRegistry().setRoutingMethod(ZoneApiMock.from(zone2), RoutingMethod.shared,
- RoutingMethod.exclusive);
+ tester.controllerTester().zoneRegistry().setRoutingMethod(ZoneApiMock.from(zone2), RoutingMethod.exclusive);
context.submit(applicationPackage).deploy();
var expectedRecords = List.of(
@@ -932,20 +899,10 @@ public class ControllerTest {
new LatencyAliasTarget(HostName.from("application.tenant.us-east-3-w.vespa.oath.cloud"),
"dns-zone-1", ZoneId.from("prod.us-east-3")).pack()),
- // The 'default' global endpoint, pointing to both zones with shared routing, via rotation
- new Record(Record.Type.CNAME,
- RecordName.from("application--tenant.global.vespa.oath.cloud"),
- RecordData.from("rotation-fqdn-01.")),
-
// The zone-scoped endpoint pointing to zone 2 with exclusive routing
new Record(Record.Type.CNAME,
RecordName.from("application.tenant.us-east-3.vespa.oath.cloud"),
- RecordData.from("lb-0--tenant:application:default--prod.us-east-3.")),
-
- // The 'east' global endpoint, pointing to zone 2 with shared routing, via rotation
- new Record(Record.Type.CNAME,
- RecordName.from("east--application--tenant.global.vespa.oath.cloud"),
- RecordData.from("rotation-fqdn-02.")));
+ RecordData.from("lb-0--tenant:application:default--prod.us-east-3.")));
assertEquals(expectedRecords, List.copyOf(tester.controllerTester().nameService().records()));
}
@@ -985,53 +942,6 @@ public class ControllerTest {
}
@Test
- public void testDeploymentWithSharedAndDirectRouting() {
- var context = tester.newDeploymentContext();
- var zone1 = ZoneId.from("prod", "us-west-1");
- var zone2 = ZoneId.from("prod", "us-east-3");
- var applicationPackageBuilder = new ApplicationPackageBuilder()
- .withoutAthenzIdentity()
- .region(zone1.region())
- .region(zone2.region());
- tester.controllerTester().zoneRegistry()
- .setRoutingMethod(ZoneApiMock.from(zone1), RoutingMethod.shared, RoutingMethod.sharedLayer4)
- .setRoutingMethod(ZoneApiMock.from(zone2), RoutingMethod.shared, RoutingMethod.sharedLayer4);
- Supplier<Set<RoutingMethod>> routingMethods = () -> tester.controller().routing().readEndpointsOf(context.deploymentIdIn(zone1))
- .asList()
- .stream()
- .map(Endpoint::routingMethod)
- .collect(Collectors.toSet());
-
- // Without satisfying requirements
- context.submit(applicationPackageBuilder.build()).deploy();
- assertEquals(Set.of(RoutingMethod.shared), routingMethods.get());
-
- // Package satisfying all requirements is submitted, but not deployed yet
- applicationPackageBuilder = applicationPackageBuilder.athenzIdentity(AthenzDomain.from("domain"), AthenzService.from("service"));
- var context2 = context.submit(applicationPackageBuilder.build());
- assertEquals("Direct routing endpoint is available after submission and before deploy",
- Set.of(RoutingMethod.shared, RoutingMethod.sharedLayer4), routingMethods.get());
- context2.deploy();
-
- // Global endpoint is added and includes directly routed endpoint name
- applicationPackageBuilder = applicationPackageBuilder.endpoint("default", "default");
- context2.submit(applicationPackageBuilder.build()).deploy();
- for (var zone : List.of(zone1, zone2)) {
- assertEquals(Set.of("rotation-id-01",
- "application.tenant.global.vespa.oath.cloud",
- "application--tenant.global.vespa.oath.cloud"),
- tester.configServer().containerEndpointNames(context.deploymentIdIn(zone)));
- }
- List<String> zoneDnsNames = tester.controller().routing().readEndpointsOf(context.deploymentIdIn(zone1))
- .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.vespa.oath.cloud"),
- zoneDnsNames);
- }
-
- @Test
public void testChangeEndpointCluster() {
var context = tester.newDeploymentContext();
var west = ZoneId.from("prod", "us-west-1");
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
index 0ac1691829a..0cc5b479304 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java
@@ -1299,7 +1299,7 @@ public class DeploymentTriggerTest {
ZoneId.from("prod.cd-aws-us-east-1a"));
tester.controllerTester()
.setZones(zones, SystemName.cd)
- .setRoutingMethod(zones, RoutingMethod.shared);
+ .setRoutingMethod(zones, RoutingMethod.sharedLayer4);
tester.controllerTester().upgradeSystem(Version.fromString("6.1"));
tester.controllerTester().computeVersionStatus();
var app = tester.newDeploymentContext();
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java
index 97cfd520e67..53a92c78c6f 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java
@@ -72,7 +72,7 @@ public class ZoneRegistryMock extends AbstractComponent implements ZoneRegistry
ZoneApiMock.fromId("prod.us-west-1"),
ZoneApiMock.fromId("prod.us-central-1"),
ZoneApiMock.fromId("prod.eu-west-1"));
- setRoutingMethod(this.zones, RoutingMethod.sharedLayer4, RoutingMethod.shared);
+ setRoutingMethod(this.zones, RoutingMethod.sharedLayer4);
}
}
@@ -119,17 +119,17 @@ public class ZoneRegistryMock extends AbstractComponent implements ZoneRegistry
}
public ZoneRegistryMock setRoutingMethod(ZoneApi zone, RoutingMethod... routingMethods) {
- return setRoutingMethod(zone, List.of(routingMethods));
+ return setRoutingMethod(zone, Set.of(routingMethods));
}
public ZoneRegistryMock setRoutingMethod(List<? extends ZoneApi> zones, RoutingMethod... routingMethods) {
- zones.forEach(zone -> setRoutingMethod(zone, List.of(routingMethods)));
+ zones.forEach(zone -> setRoutingMethod(zone, Set.of(routingMethods)));
return this;
}
- public ZoneRegistryMock setRoutingMethod(ZoneApi zone, List<RoutingMethod> routingMethods) {
- if (routingMethods.stream().distinct().count() != routingMethods.size()) {
- throw new IllegalArgumentException("Routing methods must be distinct");
+ private ZoneRegistryMock setRoutingMethod(ZoneApi zone, Set<RoutingMethod> routingMethods) {
+ if (routingMethods.stream().anyMatch(method -> method == RoutingMethod.shared)) {
+ throw new IllegalArgumentException(RoutingMethod.shared + " is not supported");
}
this.zoneRoutingMethods.put(zone, List.copyOf(routingMethods));
return this;
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..455e802e87b 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", 2, 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/ApplicationApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java
index df8db83f229..516911b3c7b 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java
@@ -1553,8 +1553,7 @@ public class ApplicationApiTest extends ControllerContainerTest {
public void support_access() {
var app = deploymentTester.newDeploymentContext(createTenantAndApplication());
var zone = ZoneId.from(Environment.prod, RegionName.from("us-west-1"));
- deploymentTester.controllerTester().zoneRegistry().setRoutingMethod(ZoneApiMock.from(zone),
- List.of(RoutingMethod.exclusive, RoutingMethod.shared));
+ deploymentTester.controllerTester().zoneRegistry().setRoutingMethod(ZoneApiMock.from(zone), RoutingMethod.exclusive);
addUserToHostedOperatorRole(HostedAthenzIdentities.from(HOSTED_VESPA_OPERATOR));
ApplicationPackage applicationPackage = new ApplicationPackageBuilder()
.athenzIdentity(com.yahoo.config.provision.AthenzDomain.from("domain"), AthenzService.from("service"))
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment.json
index a1c32b67eb0..621617f1b1c 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment.json
@@ -6,6 +6,22 @@
"region": "us-central-1",
"endpoints": [
{
+ "cluster": "default",
+ "tls": true,
+ "url": "https://instance1.application1.tenant1.us-central-1.vespa.oath.cloud/",
+ "scope": "zone",
+ "routingMethod": "sharedLayer4",
+ "legacy": false
+ },
+ {
+ "cluster": "foo",
+ "tls": true,
+ "url": "https://instance1.application1.tenant1.global.vespa.oath.cloud/",
+ "scope": "global",
+ "routingMethod": "sharedLayer4",
+ "legacy": false
+ },
+ {
"cluster": "foo",
"tls": true,
"url": "https://a0.application1.tenant1.us-central-1-r.vespa.oath.cloud/",
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-us-central-1.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-us-central-1.json
index 25d306ae764..d9ec8e4dfef 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-us-central-1.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-us-central-1.json
@@ -9,6 +9,22 @@
"region": "us-central-1",
"endpoints": [
{
+ "cluster": "default",
+ "tls": true,
+ "url": "https://instance1.application1.tenant1.us-central-1.vespa.oath.cloud/",
+ "scope": "zone",
+ "routingMethod": "sharedLayer4",
+ "legacy": false
+ },
+ {
+ "cluster": "foo",
+ "tls": true,
+ "url": "https://instance1.application1.tenant1.global.vespa.oath.cloud/",
+ "scope": "global",
+ "routingMethod": "sharedLayer4",
+ "legacy": false
+ },
+ {
"cluster": "foo",
"tls": true,
"url": "https://a0.application1.tenant1.us-central-1-r.vespa.oath.cloud/",
@@ -17,7 +33,7 @@
"legacy": false
}
],
- "clusters":"http://localhost:8080/application/v4/tenant/tenant1/application/application1/instance/instance1/environment/prod/region/us-central-1/clusters",
+ "clusters": "http://localhost:8080/application/v4/tenant/tenant1/application/application1/instance/instance1/environment/prod/region/us-central-1/clusters",
"nodes": "http://localhost:8080/zone/v2/prod/us-central-1/nodes/v2/node/?recursive=true&application=tenant1.application1.instance1",
"yamasUrl": "http://monitoring-system.test/?environment=prod&region=us-central-1&application=tenant1.application1.instance1",
"version": "(ignore)",
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/system-test-details.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/system-test-details.json
index 065ca3c1020..377b8c6ed69 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/system-test-details.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/system-test-details.json
@@ -297,7 +297,7 @@
{
"at": "(ignore)",
"type": "info",
- "message": " |-- https://instance1--application1--tenant1.us-east-1.test.vespa.oath.cloud:4443/ (cluster 'default')"
+ "message": " |-- https://instance1.application1.tenant1.us-east-1.test.vespa.oath.cloud/ (cluster 'default')"
},
{
"at": "(ignore)",
@@ -324,7 +324,7 @@
{
"at": "(ignore)",
"type": "info",
- "message": " |-- https://instance1--application1--tenant1.us-east-1.test.vespa.oath.cloud:4443/ (cluster 'default')"
+ "message": " |-- https://instance1.application1.tenant1.us-east-1.test.vespa.oath.cloud/ (cluster 'default')"
},
{
"at": "(ignore)",
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config-dev.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config-dev.json
index 047e10b16e4..3a5e6dc5dc3 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config-dev.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config-dev.json
@@ -8,7 +8,7 @@
"https://my-user.application1.tenant1.us-east-1.dev.vespa.oath.cloud/"
],
"prod.us-central-1": [
- "https://application1--tenant1.us-central-1.vespa.oath.cloud:4443/"
+ "https://application1.tenant1.us-central-1.vespa.oath.cloud/"
]
},
"zoneEndpoints": {
@@ -16,7 +16,7 @@
"default": "https://my-user.application1.tenant1.us-east-1.dev.vespa.oath.cloud/"
},
"prod.us-central-1": {
- "default": "https://application1--tenant1.us-central-1.vespa.oath.cloud:4443/"
+ "default": "https://application1.tenant1.us-central-1.vespa.oath.cloud/"
}
},
"clusters": {
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config.json
index c81ed767239..0a9236655ba 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/test-config.json
@@ -5,12 +5,12 @@
"isCI": false,
"endpoints": {
"prod.us-central-1": [
- "https://application1--tenant1.us-central-1.vespa.oath.cloud:4443/"
+ "https://application1.tenant1.us-central-1.vespa.oath.cloud/"
]
},
"zoneEndpoints": {
"prod.us-central-1": {
- "default": "https://application1--tenant1.us-central-1.vespa.oath.cloud:4443/"
+ "default": "https://application1.tenant1.us-central-1.vespa.oath.cloud/"
}
},
"clusters": {
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/routing/responses/endpoint/endpoints.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/routing/responses/endpoint/endpoints.json
index 7804b277e52..75369a19ea7 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/routing/responses/endpoint/endpoints.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/routing/responses/endpoint/endpoints.json
@@ -2,33 +2,6 @@
"endpoints": [
{
"name": "default",
- "dnsName": "a1--t1.global.vespa.oath.cloud",
- "routingMethod": "shared",
- "cluster": "default",
- "scope": "global",
- "zones": [
- {
- "routingMethod": "shared",
- "instance": "t1:a1:default",
- "environment": "prod",
- "region": "us-east-3",
- "status": "in",
- "agent": "unknown",
- "changedAt": 1497618757000
- },
- {
- "routingMethod": "shared",
- "instance": "t1:a1:default",
- "environment": "prod",
- "region": "us-west-1",
- "status": "in",
- "agent": "unknown",
- "changedAt": 1497618757000
- }
- ]
- },
- {
- "name": "default",
"dnsName": "a1.t1.global.vespa.oath.cloud",
"routingMethod": "sharedLayer4",
"cluster": "default",
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepositoryTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepositoryTest.java
index 9be95dc7a79..d7847da2404 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepositoryTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepositoryTest.java
@@ -151,13 +151,13 @@ public class RotationRepositoryTest {
ZoneApiMock.fromId("prod.cd-us-west-1"));
tester.controllerTester().zoneRegistry()
.setZones(zones)
- .setRoutingMethod(zones, RoutingMethod.shared)
+ .setRoutingMethod(zones, RoutingMethod.sharedLayer4)
.setSystemName(SystemName.cd);
tester.configServer().bootstrap(tester.controllerTester().zoneRegistry().zones().all().ids(), SystemApplication.notController());
var application2 = tester.newDeploymentContext("tenant2", "app2", "default");
application2.submit(applicationPackage).deploy();
assertEquals(List.of(new RotationId("foo-1")), rotationIds(application2.instance().rotations()));
- assertEquals("https://cd--app2--tenant2.global.vespa.oath.cloud:4443/",
+ assertEquals("https://cd.app2.tenant2.global.vespa.oath.cloud/",
tester.controller().routing().readDeclaredEndpointsOf(application2.instanceId()).primary().get().url().toString());
}