diff options
author | Martin Polden <mpolden@mpolden.no> | 2023-07-26 16:02:45 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2023-07-26 16:24:11 +0200 |
commit | e3ba83a0fdd1e31036929c172836e9996f79f16d (patch) | |
tree | c03df2abc06f0f0567c4d5503eef6039cd2773e7 /controller-server/src/test/java | |
parent | 886a16481d5023822629fd4f8f128157af9edce8 (diff) |
Remove global-service-id
Diffstat (limited to 'controller-server/src/test/java')
9 files changed, 16 insertions, 74 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 3d2a66adc81..c46a28c4567 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 @@ -384,7 +384,7 @@ public class ControllerTest { void testDnsUpdatesForGlobalEndpointLegacySyntax() { var context = tester.newDeploymentContext("tenant1", "app1", "default"); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() - .globalServiceId("foo") + .endpoint("default", "foo") .region("us-west-1") .region("us-central-1") // Two deployments should result in each DNS alias being registered once .build(); @@ -1532,22 +1532,6 @@ public class ControllerTest { } @Test - void testSubmitWithElementDeprecatedOnPreviousMajor() { - DeploymentContext context = tester.newDeploymentContext(); - var applicationPackage = new ApplicationPackageBuilder() - .compileVersion(Version.fromString("8.1")) - .region("us-west-1") - .globalServiceId("qrs") - .build(); - try { - context.submit(applicationPackage).deploy(); - fail("Expected exception"); - } catch (IllegalArgumentException e) { - assertTrue(e.getMessage().contains("Element 'prod' contains attribute 'global-service-id' deprecated since major version 7")); - } - } - - @Test void testDeactivateDeploymentUnknownByController() { DeploymentContext context = tester.newDeploymentContext(); DeploymentId deployment = context.deploymentIdIn(ZoneId.from("prod", "us-west-1")); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/ApplicationPackageBuilder.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/ApplicationPackageBuilder.java index 965201ec6da..a70125815b1 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/ApplicationPackageBuilder.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/ApplicationPackageBuilder.java @@ -65,7 +65,6 @@ public class ApplicationPackageBuilder { private String revisionTarget = "latest"; private String revisionChange = "always"; private String upgradeRollout = null; - private String globalServiceId = null; private String athenzIdentityAttributes = "athenz-domain='domain' athenz-service='service'"; private String searchDefinition = "search test { }"; private Version compileVersion = Version.fromString("6.1"); @@ -101,11 +100,6 @@ public class ApplicationPackageBuilder { return this; } - public ApplicationPackageBuilder globalServiceId(String globalServiceId) { - this.globalServiceId = globalServiceId; - return this; - } - public ApplicationPackageBuilder endpoint(String id, String containerId, String... regions) { endpointsBody.append(" <endpoint"); endpointsBody.append(" id='").append(id).append("'"); @@ -335,13 +329,7 @@ public class ApplicationPackageBuilder { xml.append(" />\n"); }); xml.append(blockChange); - xml.append(" <prod"); - if (globalServiceId != null) { - xml.append(" global-service-id='"); - xml.append(globalServiceId); - xml.append("'"); - } - xml.append(">\n"); + xml.append(" <prod>\n"); xml.append(prodBody); xml.append(" </prod>\n"); if (endpointsBody.length() > 0) { 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 53f2e85ad31..2f4e9a0dbef 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 @@ -275,7 +275,7 @@ public class MetricsReporterTest { void name_service_queue_size_metric() { var tester = new DeploymentTester(); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() - .globalServiceId("default") + .endpoint("default", "foo") .region("us-west-1") .region("us-east-3") .build(); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/ApplicationSerializerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/ApplicationSerializerTest.java index 69b473dce87..f287bc52604 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/ApplicationSerializerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/ApplicationSerializerTest.java @@ -78,8 +78,8 @@ public class ApplicationSerializerTest { DeploymentSpec deploymentSpec = DeploymentSpec.fromXml("<deployment version='1.0'>\n" + " <staging/>\n" + " <instance id=\"i1\">\n" + - " <prod global-service-id=\"default\">\n" + - " <region active=\"true\">us-west-1</region>\n" + + " <prod>\n" + + " <region>us-west-1</region>\n" + " </prod>\n" + " </instance>\n" + "</deployment>"); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/testdata/complete-application.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/testdata/complete-application.json index ec36f52c23a..32f7e8e8f5a 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/testdata/complete-application.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/testdata/complete-application.json @@ -2,7 +2,7 @@ "id": "tenant1:app1", "internal": true, "deploymentIssueId": "321", - "deploymentSpecField": "<deployment version='1.0'>\n <test />\n <!--<staging />-->\n <prod global-service-id=\"foo\">\n <region active=\"true\">us-east-3</region>\n <region active=\"true\">us-west-1</region>\n </prod>\n</deployment>\n", + "deploymentSpecField": "<deployment version='1.0'>\n <test />\n <!--<staging />-->\n <prod>\n <region>us-east-3</region>\n <region>us-west-1</region>\n </prod>\n</deployment>\n", "validationOverrides": "<validation-overrides>\n <allow until=\"2016-04-28\" comment=\"Renaming content cluster\">content-cluster-removal</allow>\n <allow until=\"2016-08-22\" comment=\"Migrating us-east-3 to C-2E\">cluster-size-reduction</allow>\n <allow until=\"2017-06-30\" comment=\"Test Vespa upgrade tests\">force-automatic-tenant-upgrade-test</allow>\n</validation-overrides>\n", "projectId": 102889, "deployingField": { diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiCloudTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiCloudTest.java index 3cd9d586350..915466dac26 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiCloudTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiCloudTest.java @@ -542,7 +542,7 @@ public class ApplicationApiCloudTest extends ControllerContainerCloudTest { var applicationPackage = new ApplicationPackageBuilder() .trustDefaultCertificate() .instances("default") - .globalServiceId("foo") + .endpoint("default", "foo") .region("aws-us-east-1c") .build(); new ControllerTester(tester).upgradeSystem(new Version("6.1")); 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 14c279c9ef8..98775ea214d 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 @@ -130,7 +130,7 @@ public class ApplicationApiTest extends ControllerContainerTest { private static final ApplicationPackage applicationPackageDefault = new ApplicationPackageBuilder() .withoutAthenzIdentity() .instances("default") - .globalServiceId("foo") + .endpoint("default", "foo") .region("us-central-1") .region("us-east-3") .region("us-west-1") @@ -140,7 +140,7 @@ public class ApplicationApiTest extends ControllerContainerTest { private static final ApplicationPackage applicationPackageInstance1 = new ApplicationPackageBuilder() .withoutAthenzIdentity() .instances("instance1") - .globalServiceId("foo") + .endpoint("default", "foo") .region("us-central-1") .region("us-east-3") .region("us-west-1") @@ -343,7 +343,7 @@ public class ApplicationApiTest extends ControllerContainerTest { ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .withoutAthenzIdentity() .instances("instance1") - .globalServiceId("foo") + .endpoint("default", "foo") .region("us-west-1") .region("us-east-3") .allow(ValidationId.globalEndpointChange) @@ -864,7 +864,7 @@ public class ApplicationApiTest extends ControllerContainerTest { // Third attempt has a service under the domain of the tenant, and also succeeds. ApplicationPackage packageWithService = new ApplicationPackageBuilder() .instances("instance1") - .globalServiceId("foo") + .endpoint("default", "foo") .athenzIdentity(com.yahoo.config.provision.AthenzDomain.from(ATHENZ_TENANT_DOMAIN.getName()), AthenzService.from("service")) .region("us-central-1") .parallel("us-west-1", "us-east-3") @@ -1043,7 +1043,7 @@ public class ApplicationApiTest extends ControllerContainerTest { var eastZone = ZoneId.from("prod", "us-east-3"); var applicationPackage = new ApplicationPackageBuilder() .instances("instance1") - .globalServiceId("foo") + .endpoint("default", "foo") .region(westZone.region()) .region(eastZone.region()) .build(); 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 02f030aa758..e41856b0c3d 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 @@ -234,27 +234,6 @@ public class RoutingPoliciesTest { } @Test - void global_routing_policies_legacy_global_service_id() { - var tester = new RoutingPoliciesTester(); - var context = tester.newDeploymentContext("tenant1", "app1", "default"); - int clustersPerZone = 2; - int numberOfDeployments = 2; - var applicationPackage = applicationPackageBuilder() - .region(zone1.region()) - .region(zone2.region()) - .globalServiceId("c0") - .build(); - tester.provisionLoadBalancers(clustersPerZone, context.instanceId(), zone1, zone2); - - // Creates alias records - context.submit(applicationPackage).deferLoadBalancerProvisioningIn(Environment.prod).deploy(); - tester.assertTargets(context.instanceId(), EndpointId.defaultId(), 0, zone1, zone2); - assertEquals(numberOfDeployments * clustersPerZone, - tester.policiesOf(context.instance().id()).size(), - "Routing policy count is equal to cluster count"); - } - - @Test void zone_routing_policies() { zone_routing_policies(false); zone_routing_policies(true); 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 168a1345c39..6190680d098 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 @@ -41,7 +41,7 @@ public class RotationRepositoryTest { ); private static final ApplicationPackage applicationPackage = new ApplicationPackageBuilder() - .globalServiceId("foo") + .endpoint("default", "foo") .region("us-east-3") .region("us-west-1") .build(); @@ -74,7 +74,7 @@ public class RotationRepositoryTest { // Adding region updates rotation var applicationPackage = new ApplicationPackageBuilder() - .globalServiceId("foo") + .endpoint("default", "foo") .region("us-east-3") .region("us-west-1") .region("us-central-1") @@ -116,15 +116,6 @@ public class RotationRepositoryTest { } @Test - void too_few_zones() { - ApplicationPackage applicationPackage = new ApplicationPackageBuilder() - .globalServiceId("foo") - .region("us-east-3") - .build(); - application.submit(applicationPackage).runJobExpectingFailure(DeploymentContext.systemTest, "less than 2 prod zones are defined"); - } - - @Test void no_rotation_assigned_for_application_without_service_id() { ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .region("us-east-3") @@ -137,7 +128,7 @@ public class RotationRepositoryTest { @Test void prefixes_system_when_not_main() { ApplicationPackage applicationPackage = new ApplicationPackageBuilder() - .globalServiceId("foo") + .endpoint("default", "foo") .region("cd-us-east-1") .region("cd-us-west-1") .build(); @@ -164,7 +155,7 @@ public class RotationRepositoryTest { .instances("instance1,instance2") .region("us-central-1") .parallel("us-west-1", "us-east-3") - .globalServiceId("global") + .endpoint("default", "global") .build(); var instance1 = tester.newDeploymentContext("tenant1", "application1", "instance1") .submit(applicationPackage) |