From abc51d778d3f370e04cf79d649db59cc3e596449 Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Wed, 26 Jul 2023 16:02:45 +0200 Subject: Remove global-service-id --- .../application/api/DeploymentInstanceSpec.java | 21 ++---- .../api/xml/DeploymentSpecXmlReader.java | 15 ----- .../config/application/api/DeploymentSpecTest.java | 78 +--------------------- .../api/DeploymentSpecWithoutInstanceTest.java | 42 +----------- .../validation/DeploymentSpecValidator.java | 3 - .../src/main/resources/schema/deployment.rnc | 1 - .../src/test/cfg/application/app1/deployment.xml | 6 +- .../app_invalid_deployment_xml/deployment.xml | 2 +- .../invalid_parallel_deployment_xml/deployment.xml | 2 +- .../yahoo/config/model/ApplicationDeployTest.java | 10 ++- .../validation/DeploymentSpecValidatorTest.java | 13 ---- .../container/xml/ContainerModelBuilderTest.java | 36 ---------- .../deployment-with-instances.xml | 18 ++--- .../src/test/schema-test-files/deployment.xml | 16 ++--- .../server/zookeeper/ZKApplicationPackageTest.java | 3 - .../vespa/hosted/controller/RoutingController.java | 27 +------- .../pkg/ApplicationPackageValidator.java | 40 ++--------- .../hosted/controller/routing/RoutingPolicies.java | 4 -- .../routing/rotation/RotationRepository.java | 47 ------------- .../vespa/hosted/controller/ControllerTest.java | 18 +---- .../deployment/ApplicationPackageBuilder.java | 14 +--- .../maintenance/MetricsReporterTest.java | 2 +- .../persistence/ApplicationSerializerTest.java | 4 +- .../persistence/testdata/complete-application.json | 2 +- .../application/ApplicationApiCloudTest.java | 2 +- .../restapi/application/ApplicationApiTest.java | 10 +-- .../controller/routing/RoutingPoliciesTest.java | 21 ------ .../routing/rotation/RotationRepositoryTest.java | 17 ++--- 28 files changed, 58 insertions(+), 416 deletions(-) diff --git a/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentInstanceSpec.java b/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentInstanceSpec.java index b6f934c8824..4ca96453ad1 100644 --- a/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentInstanceSpec.java +++ b/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentInstanceSpec.java @@ -1,7 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.config.application.api; -import ai.vespa.validation.Validation; import com.yahoo.config.provision.AthenzService; import com.yahoo.config.provision.CloudAccount; import com.yahoo.config.provision.CloudName; @@ -58,7 +57,6 @@ public class DeploymentInstanceSpec extends DeploymentSpec.Steps { private final int maxRisk; private final int maxIdleHours; private final List changeBlockers; - private final Optional globalServiceId; private final Optional athenzService; private final Map cloudAccounts; private final Optional hostTTL; @@ -76,7 +74,6 @@ public class DeploymentInstanceSpec extends DeploymentSpec.Steps { DeploymentSpec.UpgradeRollout upgradeRollout, int minRisk, int maxRisk, int maxIdleHours, List changeBlockers, - Optional globalServiceId, Optional athenzService, Map cloudAccounts, Optional hostTTL, @@ -100,7 +97,6 @@ public class DeploymentInstanceSpec extends DeploymentSpec.Steps { this.maxRisk = require(maxRisk >= minRisk, maxRisk, "maximum risk cannot be less than minimum risk score"); this.maxIdleHours = requireInRange(maxIdleHours, "maximum idle hours", 0, 168); this.changeBlockers = Objects.requireNonNull(changeBlockers); - this.globalServiceId = Objects.requireNonNull(globalServiceId); this.athenzService = Objects.requireNonNull(athenzService); this.cloudAccounts = Map.copyOf(cloudAccounts); this.hostTTL = Objects.requireNonNull(hostTTL); @@ -111,7 +107,7 @@ public class DeploymentInstanceSpec extends DeploymentSpec.Steps { this.zoneEndpoints = Collections.unmodifiableMap(zoneEndpointsCopy); this.bcp = Objects.requireNonNull(bcp); validateZones(new HashSet<>(), new HashSet<>(), this); - validateEndpoints(globalServiceId, this.endpoints); + validateEndpoints(this.endpoints); validateChangeBlockers(changeBlockers, now); validateBcp(bcp); hostTTL.filter(Duration::isNegative).ifPresent(ttl -> illegal("Host TTL cannot be negative")); @@ -155,11 +151,7 @@ public class DeploymentInstanceSpec extends DeploymentSpec.Steps { } /** Throw an IllegalArgumentException if an endpoint refers to a region that is not declared in 'prod' */ - private void validateEndpoints(Optional globalServiceId, List endpoints) { - if (globalServiceId.isPresent() && ! endpoints.isEmpty()) { - throw new IllegalArgumentException("Providing both 'endpoints' and 'global-service-id'. Use only 'endpoints'."); - } - + private void validateEndpoints(List endpoints) { var regions = prodRegions(); for (var endpoint : endpoints){ for (var endpointRegion : endpoint.regions()) { @@ -243,9 +235,6 @@ public class DeploymentInstanceSpec extends DeploymentSpec.Steps { /** Returns time windows where upgrades are disallowed for these instances */ public List changeBlocker() { return changeBlockers; } - /** Returns the ID of the service to expose through global routing, if present */ - public Optional globalServiceId() { return globalServiceId; } - /** Returns whether the instances in this step can upgrade at the given instant */ public boolean canUpgradeAt(Instant instant) { return changeBlockers.stream().filter(block -> block.blocksVersions()) @@ -323,8 +312,7 @@ public class DeploymentInstanceSpec extends DeploymentSpec.Steps { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DeploymentInstanceSpec other = (DeploymentInstanceSpec) o; - return globalServiceId.equals(other.globalServiceId) && - upgradePolicy == other.upgradePolicy && + return upgradePolicy == other.upgradePolicy && revisionTarget == other.revisionTarget && upgradeRollout == other.upgradeRollout && changeBlockers.equals(other.changeBlockers) && @@ -339,7 +327,7 @@ public class DeploymentInstanceSpec extends DeploymentSpec.Steps { @Override public int hashCode() { - return Objects.hash(globalServiceId, upgradePolicy, revisionTarget, upgradeRollout, changeBlockers, steps(), athenzService, notifications, endpoints, zoneEndpoints, bcp, tags); + return Objects.hash(upgradePolicy, revisionTarget, upgradeRollout, changeBlockers, steps(), athenzService, notifications, endpoints, zoneEndpoints, bcp, tags); } int deployableHashCode() { @@ -349,7 +337,6 @@ public class DeploymentInstanceSpec extends DeploymentSpec.Steps { toHash[i++] = name; toHash[i++] = endpoints; toHash[i++] = zoneEndpoints; - toHash[i++] = globalServiceId; toHash[i++] = tags; toHash[i++] = bcp; toHash[i++] = cloudAccounts; diff --git a/config-model-api/src/main/java/com/yahoo/config/application/api/xml/DeploymentSpecXmlReader.java b/config-model-api/src/main/java/com/yahoo/config/application/api/xml/DeploymentSpecXmlReader.java index 38562eefb03..13bc09883fa 100644 --- a/config-model-api/src/main/java/com/yahoo/config/application/api/xml/DeploymentSpecXmlReader.java +++ b/config-model-api/src/main/java/com/yahoo/config/application/api/xml/DeploymentSpecXmlReader.java @@ -93,7 +93,6 @@ public class DeploymentSpecXmlReader { private static final String athenzDomainAttribute = "athenz-domain"; private static final String testerFlavorAttribute = "tester-flavor"; private static final String majorVersionAttribute = "major-version"; - private static final String globalServiceIdAttribute = "global-service-id"; private static final String cloudAccountAttribute = "cloud-account"; private static final String hostTTLAttribute = "empty-host-ttl"; @@ -234,7 +233,6 @@ public class DeploymentSpecXmlReader { upgradeRollout, minRisk, maxRisk, maxIdleHours, changeBlockers, - Optional.ofNullable(prodAttributes.get(globalServiceIdAttribute)), athenzService, cloudAccounts, hostTTL, @@ -268,12 +266,6 @@ public class DeploymentSpecXmlReader { Optional athenzService = mostSpecificAttribute(stepTag, athenzServiceAttribute).map(AthenzService::from); Optional testerFlavor = mostSpecificAttribute(stepTag, testerFlavorAttribute); - if (prodTag.equals(stepTag.getTagName())) { - readGlobalServiceId(stepTag).ifPresent(id -> prodAttributes.put(globalServiceIdAttribute, id)); - } else { - if (readGlobalServiceId(stepTag).isPresent()) illegal("Attribute '" + globalServiceIdAttribute + "' is only valid on 'prod' tag"); - } - switch (stepTag.getTagName()) { case testTag: if (Stream.iterate(stepTag, Objects::nonNull, Node::getParentNode) @@ -714,13 +706,6 @@ public class DeploymentSpecXmlReader { return mostSpecificAttribute(tag, hostTTLAttribute).map(s -> toDuration(s, "empty host TTL")); } - private Optional readGlobalServiceId(Element environmentTag) { - String globalServiceId = environmentTag.getAttribute(globalServiceIdAttribute); - if (globalServiceId.isEmpty()) return Optional.empty(); - deprecate(environmentTag, List.of(globalServiceIdAttribute), 7, "See https://cloud.vespa.ai/en/reference/routing#deprecated-syntax"); - return Optional.of(globalServiceId); - } - private List readChangeBlockers(Element parent, Element globalBlockersParent) { List changeBlockers = new ArrayList<>(); if (globalBlockersParent != parent) { diff --git a/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java b/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java index d4312a0e54e..c33277dfc6f 100644 --- a/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java +++ b/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java @@ -13,8 +13,8 @@ import com.yahoo.config.provision.InstanceName; import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.Tags; import com.yahoo.config.provision.ZoneEndpoint; -import com.yahoo.config.provision.ZoneEndpoint.AllowedUrn; import com.yahoo.config.provision.ZoneEndpoint.AccessType; +import com.yahoo.config.provision.ZoneEndpoint.AllowedUrn; import com.yahoo.test.ManualClock; import org.junit.Test; @@ -46,7 +46,6 @@ import static com.yahoo.config.provision.zone.ZoneId.from; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -74,7 +73,6 @@ public class DeploymentSpecTest { assertTrue(spec.requireInstance("default").concerns(test, Optional.of(RegionName.from("region1")))); // test steps specify no region assertFalse(spec.requireInstance("default").concerns(staging, Optional.empty())); assertFalse(spec.requireInstance("default").concerns(prod, Optional.empty())); - assertFalse(spec.requireInstance("default").globalServiceId().isPresent()); } @Test @@ -110,7 +108,6 @@ public class DeploymentSpecTest { assertFalse(spec.requireInstance("default").concerns(test, Optional.empty())); assertTrue(spec.requireInstance("default").concerns(staging, Optional.empty())); assertFalse(spec.requireInstance("default").concerns(prod, Optional.empty())); - assertFalse(spec.requireInstance("default").globalServiceId().isPresent()); } @Test @@ -141,7 +138,6 @@ public class DeploymentSpecTest { assertTrue(spec.requireInstance("default").concerns(prod, Optional.of(RegionName.from("us-east1")))); assertTrue(spec.requireInstance("default").concerns(prod, Optional.of(RegionName.from("us-west1")))); assertFalse(spec.requireInstance("default").concerns(prod, Optional.of(RegionName.from("no-such-region")))); - assertFalse(spec.requireInstance("default").globalServiceId().isPresent()); assertEquals(DeploymentSpec.UpgradePolicy.defaultPolicy, spec.requireInstance("default").upgradePolicy()); assertEquals(DeploymentSpec.RevisionTarget.latest, spec.requireInstance("default").revisionTarget()); @@ -350,68 +346,6 @@ public class DeploymentSpecTest { assertTrue(instance.concerns(prod, Optional.of(RegionName.from("us-east1")))); assertTrue(instance.concerns(prod, Optional.of(RegionName.from("us-west1")))); assertFalse(instance.concerns(prod, Optional.of(RegionName.from("no-such-region")))); - assertFalse(instance.globalServiceId().isPresent()); - } - - @Test - public void productionSpecWithGlobalServiceId() { - StringReader r = new StringReader( - "" + - " " + - " " + - " us-east-1" + - " us-west-1" + - " " + - " " + - "" - ); - - DeploymentSpec spec = DeploymentSpec.fromXml(r); - assertEquals(spec.requireInstance("default").globalServiceId(), Optional.of("query")); - } - - @Test(expected=IllegalArgumentException.class) - public void globalServiceIdInTest() { - StringReader r = new StringReader( - "" + - " " + - " " + - " " + - "" - ); - DeploymentSpec.fromXml(r); - } - - @Test(expected=IllegalArgumentException.class) - public void globalServiceIdInStaging() { - StringReader r = new StringReader( - "" + - " " + - " " + - " " + - "" - ); - DeploymentSpec.fromXml(r); - } - - @Test - public void productionSpecWithGlobalServiceIdBeforeStaging() { - StringReader r = new StringReader( - "" + - " " + - " " + - " " + - " us-west-1" + - " us-central-1" + - " us-east-3" + - " " + - " " + - " " + - "" - ); - - DeploymentSpec spec = DeploymentSpec.fromXml(r); - assertEquals("qrs", spec.requireInstance("default").globalServiceId().get()); } @Test @@ -1734,16 +1668,6 @@ public class DeploymentSpecTest { """).deployableHashCode()); - assertNotEquals(DeploymentSpec.fromXml(referenceSpec).deployableHashCode(), - DeploymentSpec.fromXml(""" - - - - name - - - """).deployableHashCode()); - assertNotEquals(DeploymentSpec.fromXml(referenceSpec).deployableHashCode(), DeploymentSpec.fromXml(""" diff --git a/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecWithoutInstanceTest.java b/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecWithoutInstanceTest.java index e5578723612..a8c3913c498 100644 --- a/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecWithoutInstanceTest.java +++ b/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecWithoutInstanceTest.java @@ -8,8 +8,8 @@ import com.yahoo.config.provision.Environment; import com.yahoo.config.provision.InstanceName; import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.ZoneEndpoint; -import com.yahoo.config.provision.ZoneEndpoint.AllowedUrn; import com.yahoo.config.provision.ZoneEndpoint.AccessType; +import com.yahoo.config.provision.ZoneEndpoint.AllowedUrn; import org.junit.Test; import java.io.StringReader; @@ -27,7 +27,6 @@ import static com.yahoo.config.application.api.Notifications.Role.author; import static com.yahoo.config.application.api.Notifications.When.failing; import static com.yahoo.config.application.api.Notifications.When.failingCommit; import static com.yahoo.config.provision.CloudName.AWS; -import static com.yahoo.config.provision.Environment.dev; import static com.yahoo.config.provision.Environment.prod; import static com.yahoo.config.provision.Environment.test; import static com.yahoo.config.provision.zone.ZoneId.defaultId; @@ -59,7 +58,6 @@ public class DeploymentSpecWithoutInstanceTest { assertTrue(spec.requireInstance("default").concerns(test, Optional.of(RegionName.from("region1")))); // test steps specify no region assertFalse(spec.requireInstance("default").concerns(Environment.staging, Optional.empty())); assertFalse(spec.requireInstance("default").concerns(prod, Optional.empty())); - assertFalse(spec.requireInstance("default").globalServiceId().isPresent()); } @Test @@ -91,7 +89,6 @@ public class DeploymentSpecWithoutInstanceTest { assertFalse(spec.requireInstance("default").concerns(test, Optional.empty())); assertTrue(spec.requireInstance("default").concerns(Environment.staging, Optional.empty())); assertFalse(spec.requireInstance("default").concerns(prod, Optional.empty())); - assertFalse(spec.requireInstance("default").globalServiceId().isPresent()); } @Test @@ -120,8 +117,7 @@ public class DeploymentSpecWithoutInstanceTest { assertTrue(spec.requireInstance("default").concerns(prod, Optional.of(RegionName.from("us-east1")))); assertTrue(spec.requireInstance("default").concerns(prod, Optional.of(RegionName.from("us-west1")))); assertFalse(spec.requireInstance("default").concerns(prod, Optional.of(RegionName.from("no-such-region")))); - assertFalse(spec.requireInstance("default").globalServiceId().isPresent()); - + assertEquals(DeploymentSpec.UpgradePolicy.defaultPolicy, spec.requireInstance("default").upgradePolicy()); assertEquals(DeploymentSpec.UpgradeRollout.separate, spec.requireInstance("default").upgradeRollout()); } @@ -163,7 +159,6 @@ public class DeploymentSpecWithoutInstanceTest { assertTrue(spec.requireInstance("default").concerns(prod, Optional.of(RegionName.from("us-east1")))); assertTrue(spec.requireInstance("default").concerns(prod, Optional.of(RegionName.from("us-west1")))); assertFalse(spec.requireInstance("default").concerns(prod, Optional.of(RegionName.from("no-such-region")))); - assertFalse(spec.requireInstance("default").globalServiceId().isPresent()); } @Test @@ -236,21 +231,6 @@ public class DeploymentSpecWithoutInstanceTest { DeploymentSpec.fromXml(r); } - @Test - public void productionSpecWithGlobalServiceId() { - StringReader r = new StringReader( - "" + - " " + - " us-east-1" + - " us-west-1" + - " " + - "" - ); - - DeploymentSpec spec = DeploymentSpec.fromXml(r); - assertEquals(spec.requireInstance("default").globalServiceId(), Optional.of("query")); - } - @Test(expected=IllegalArgumentException.class) public void globalServiceIdInTest() { StringReader r = new StringReader( @@ -271,24 +251,6 @@ public class DeploymentSpecWithoutInstanceTest { DeploymentSpec.fromXml(r); } - @Test - public void productionSpecWithGlobalServiceIdBeforeStaging() { - StringReader r = new StringReader( - "" + - " " + - " " + - " us-west-1" + - " us-central-1" + - " us-east-3" + - " " + - " " + - "" - ); - - DeploymentSpec spec = DeploymentSpec.fromXml(r); - assertEquals("qrs", spec.requireInstance("default").globalServiceId().get()); - } - @Test public void productionSpecWithUpgradeRollout() { StringReader r = new StringReader( diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/DeploymentSpecValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/DeploymentSpecValidator.java index 0193eacba3a..d919a35c7ef 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/DeploymentSpecValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/DeploymentSpecValidator.java @@ -29,9 +29,6 @@ public class DeploymentSpecValidator extends Validator { DeploymentSpec deploymentSpec = DeploymentSpec.fromXml(deploymentReader); List containers = model.getRoot().configModelRepo().getModels(ContainerModel.class); for (DeploymentInstanceSpec instance : deploymentSpec.instances()) { - instance.globalServiceId().ifPresent(globalServiceId -> { - requireClusterId(containers, instance.name(), "Attribute 'globalServiceId'", globalServiceId); - }); instance.endpoints().forEach(endpoint -> { requireClusterId(containers, instance.name(), "Endpoint '" + endpoint.endpointId() + "'", endpoint.containerId()); diff --git a/config-model/src/main/resources/schema/deployment.rnc b/config-model/src/main/resources/schema/deployment.rnc index d47ce81eaac..87783c1ee20 100644 --- a/config-model/src/main/resources/schema/deployment.rnc +++ b/config-model/src/main/resources/schema/deployment.rnc @@ -122,7 +122,6 @@ Perf = element perf { } Prod = element prod { - attribute global-service-id { text }? & attribute athenz-service { xsd:string }? & attribute tester-flavor { xsd:string }? & attribute cloud-account { xsd:string }? & diff --git a/config-model/src/test/cfg/application/app1/deployment.xml b/config-model/src/test/cfg/application/app1/deployment.xml index a8771123ecc..25954df1c7d 100644 --- a/config-model/src/test/cfg/application/app1/deployment.xml +++ b/config-model/src/test/cfg/application/app1/deployment.xml @@ -2,8 +2,8 @@ - - us-east-3 - us-west-1 + + us-east-3 + us-west-1 diff --git a/config-model/src/test/cfg/application/app_invalid_deployment_xml/deployment.xml b/config-model/src/test/cfg/application/app_invalid_deployment_xml/deployment.xml index 738a3397aad..43f7d74ca69 100644 --- a/config-model/src/test/cfg/application/app_invalid_deployment_xml/deployment.xml +++ b/config-model/src/test/cfg/application/app_invalid_deployment_xml/deployment.xml @@ -2,7 +2,7 @@ - + us-east-3 us-west-1 diff --git a/config-model/src/test/cfg/application/invalid_parallel_deployment_xml/deployment.xml b/config-model/src/test/cfg/application/invalid_parallel_deployment_xml/deployment.xml index 4eaf7926078..24e1ec69507 100644 --- a/config-model/src/test/cfg/application/invalid_parallel_deployment_xml/deployment.xml +++ b/config-model/src/test/cfg/application/invalid_parallel_deployment_xml/deployment.xml @@ -2,7 +2,7 @@ - + diff --git a/config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java b/config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java index c00b2846021..e975421002e 100644 --- a/config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java +++ b/config-model/src/test/java/com/yahoo/config/model/ApplicationDeployTest.java @@ -1,7 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.config.model; -import com.google.common.io.Files; import com.yahoo.config.application.api.ApplicationMetaData; import com.yahoo.config.application.api.ApplicationPackage; import com.yahoo.config.application.api.UnparsedConfigDefinition; @@ -35,7 +34,12 @@ import java.util.Map; import java.util.Set; import java.util.jar.JarEntry; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; public class ApplicationDeployTest { @@ -194,7 +198,7 @@ public class ApplicationDeployTest { void testThatAppWithInvalidParallelDeploymentFails() throws IOException { String expectedMessage = """ 4: - 5: + 5: 6: 7: 8: diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/DeploymentSpecValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/DeploymentSpecValidatorTest.java index dba8205c0e7..92efac74530 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/DeploymentSpecValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/DeploymentSpecValidatorTest.java @@ -18,19 +18,6 @@ import static org.junit.jupiter.api.Assertions.fail; */ public class DeploymentSpecValidatorTest { - @Test - void testDeploymentWithNonExistentGlobalId() { - var deploymentXml = "" + - "" + - " " + - " " + - " us-east" + - " " + - ""; - assertValidationError("Attribute 'globalServiceId' in instance default: 'non-existing' specified in " + - "deployment.xml does not match any container cluster ID", deploymentXml); - } - @Test void testEndpointNonExistentContainerId() { var deploymentXml = "" + diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java index f0c39ecc920..94d98f526a0 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java @@ -790,42 +790,6 @@ public class ContainerModelBuilderTest extends ContainerModelBuilderTestBase { } } - @Test - void logs_deployment_spec_deprecations() throws Exception { - String containerService = joinLines("", - " ", - " ", - " ", - ""); - String deploymentXml = joinLines("", - " ", - " us-east-1", - " ", - ""); - - ApplicationPackage applicationPackage = new MockApplicationPackage.Builder() - .withServices(containerService) - .withDeploymentSpec(deploymentXml) - .build(); - - TestLogger logger = new TestLogger(); - DeployState deployState = new DeployState.Builder() - .applicationPackage(applicationPackage) - .zone(new Zone(Environment.prod, RegionName.from("us-east-1"))) - .properties(new TestProperties().setHostedVespa(true)) - .deployLogger(logger) - .build(); - - createModel(root, deployState, null, DomBuilderTest.parse(containerService)); - assertFalse(logger.msgs.isEmpty()); - assertEquals(Level.WARNING, logger.msgs.get(0).getFirst()); - assertEquals(Level.WARNING, logger.msgs.get(1).getFirst()); - assertEquals("Element 'prod' contains attribute 'global-service-id' deprecated since major version 7. See https://cloud.vespa.ai/en/reference/routing#deprecated-syntax", - logger.msgs.get(0).getSecond()); - assertEquals("Element 'region' contains attribute 'active' deprecated since major version 7. See https://cloud.vespa.ai/en/reference/routing#deprecated-syntax", - logger.msgs.get(1).getSecond()); - } - private void assertComponentConfigured(ApplicationContainer container, String id) { assertTrue(container.getComponents().getComponents().stream().anyMatch(component -> id.equals(component.getComponentId().getName()))); } diff --git a/config-model/src/test/schema-test-files/deployment-with-instances.xml b/config-model/src/test/schema-test-files/deployment-with-instances.xml index 3b872f4c1cf..c9f3af49ac2 100644 --- a/config-model/src/test/schema-test-files/deployment-with-instances.xml +++ b/config-model/src/test/schema-test-files/deployment-with-instances.xml @@ -9,19 +9,19 @@ - - us-west-1 + + us-west-1 - us-central-1 + us-central-1 - us-east-3 + us-east-3 - us-north-1 - us-south-1 + us-north-1 + us-south-1 - us-north-2 - us-south-2 + us-north-2 + us-south-2 @@ -55,7 +55,7 @@ - us-central-1 + us-central-1 diff --git a/config-model/src/test/schema-test-files/deployment.xml b/config-model/src/test/schema-test-files/deployment.xml index bc0f070d88c..8317bf4b80c 100644 --- a/config-model/src/test/schema-test-files/deployment.xml +++ b/config-model/src/test/schema-test-files/deployment.xml @@ -5,19 +5,19 @@ - - us-west-1 + + us-west-1 - us-central-1 + us-central-1 - us-east-3 + us-east-3 - us-north-1 - us-south-1 + us-north-1 + us-south-1 - us-north-2 - us-south-2 + us-north-2 + us-south-2 diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackageTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackageTest.java index f3a2c42852f..9508a67fc01 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackageTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackageTest.java @@ -2,7 +2,6 @@ package com.yahoo.vespa.config.server.zookeeper; import com.yahoo.component.Version; -import com.yahoo.config.application.api.DeploymentSpec; import com.yahoo.config.model.deploy.DeployState; import com.yahoo.config.provision.AllocatedHosts; import com.yahoo.config.provision.ClusterMembership; @@ -102,8 +101,6 @@ public class ZKApplicationPackageTest { assertEquals(dockerImage, readInfo.getHosts().iterator().next().dockerImageRepo().get().asString()); assertTrue(zkApp.getDeployment().isPresent()); assertFalse(zkApp.getDeploymentSpec().isEmpty()); - assertEquals("mydisc", DeploymentSpec.fromXml(zkApp.getDeployment().get()).requireInstance("default").globalServiceId().get()); - assertEquals("mydisc", zkApp.getDeploymentSpec().requireInstance("default").globalServiceId().get()); } private void feed(com.yahoo.vespa.curator.Curator zk, File dirToFeed) throws IOException { 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 3d550973f22..bceef3fd96f 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 @@ -4,7 +4,6 @@ package com.yahoo.vespa.hosted.controller; import com.google.common.hash.HashCode; import com.google.common.hash.Hashing; import com.google.common.io.BaseEncoding; -import com.yahoo.config.application.api.DeploymentInstanceSpec; import com.yahoo.config.application.api.DeploymentSpec; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.ClusterSpec; @@ -158,15 +157,6 @@ public class RoutingController { DeploymentSpec deploymentSpec = application.deploymentSpec(); for (var spec : deploymentSpec.instances()) { ApplicationId instance = application.id().instance(spec.name()); - // Add endpoint declared with legacy syntax - spec.globalServiceId().ifPresent(clusterId -> { - List deployments = spec.zones().stream() - .filter(zone -> zone.concerns(Environment.prod)) - .map(zone -> new DeploymentId(instance, ZoneId.from(Environment.prod, zone.region().get()))) - .toList(); - RoutingId routingId = RoutingId.of(instance, EndpointId.defaultId()); - endpoints.addAll(computeGlobalEndpoints(routingId, ClusterSpec.Id.from(clusterId), deployments, generatedEndpoints)); - }); // Add endpoints declared with current syntax spec.endpoints().forEach(declaredEndpoint -> { RoutingId routingId = RoutingId.of(instance, EndpointId.of(declaredEndpoint.endpointId())); @@ -275,7 +265,6 @@ public class RoutingController { } // Add endpoints backed by a rotation, and register them in DNS if necessary - boolean registerLegacyNames = requiresLegacyNames(application.get().deploymentSpec(), instanceName); Instance instance = application.get().require(instanceName); Set containerEndpoints = new HashSet<>(); DeploymentId deployment = new DeploymentId(instance.id(), zone); @@ -285,16 +274,11 @@ public class RoutingController { EndpointList rotationEndpoints = globalEndpoints.named(assignedRotation.endpointId(), Scope.global) .requiresRotation(); - // Skip rotations which do not apply to this zone. Legacy names always point to all zones - if (!registerLegacyNames && !assignedRotation.regions().contains(zone.region())) { + // Skip rotations which do not apply to this zone + if (!assignedRotation.regions().contains(zone.region())) { continue; } - // Omit legacy DNS names when assigning rotations using syntax - if (!registerLegacyNames) { - rotationEndpoints = rotationEndpoints.not().legacy(); - } - // Register names in DNS Rotation rotation = rotationRepository.requireRotation(assignedRotation.rotationId()); for (var endpoint : rotationEndpoints) { @@ -480,13 +464,6 @@ public class RoutingController { return randomizedEndpoints.with(FetchVector.Dimension.APPLICATION_ID, instance.serializedForm()).value(); } - /** Whether legacy global DNS names should be available for given application */ - private static boolean requiresLegacyNames(DeploymentSpec deploymentSpec, InstanceName instanceName) { - return deploymentSpec.instance(instanceName) - .flatMap(DeploymentInstanceSpec::globalServiceId) - .isPresent(); - } - /** Create a common name based on a hash of given application. This must be less than 64 characters long. */ private static String commonNameHashOf(ApplicationId application, SystemName system) { @SuppressWarnings("deprecation") // for Hashing.sha1() diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ApplicationPackageValidator.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ApplicationPackageValidator.java index 186e6838a71..0c05d710763 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ApplicationPackageValidator.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ApplicationPackageValidator.java @@ -21,8 +21,6 @@ import com.yahoo.config.provision.zone.ZoneApi; import com.yahoo.config.provision.zone.ZoneId; import com.yahoo.vespa.hosted.controller.Application; import com.yahoo.vespa.hosted.controller.Controller; -import com.yahoo.vespa.hosted.controller.application.EndpointId; -import com.yahoo.vespa.hosted.controller.versions.VespaVersion; import java.time.Instant; import java.util.ArrayList; @@ -31,7 +29,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Optional; import java.util.Set; import java.util.TreeSet; import java.util.stream.Collectors; @@ -179,9 +176,10 @@ public class ApplicationPackageValidator { if (applicationPackage.validationOverrides().allows(validationId, instant)) return; var endpoints = application.deploymentSpec().instance(instanceName) - .map(ApplicationPackageValidator::allEndpointsOf) + .map(deploymentInstanceSpec1 -> deploymentInstanceSpec1.endpoints()) .orElseGet(List::of); - var newEndpoints = allEndpointsOf(applicationPackage.deploymentSpec().requireInstance(instanceName)); + DeploymentInstanceSpec deploymentInstanceSpec = applicationPackage.deploymentSpec().requireInstance(instanceName); + var newEndpoints = new ArrayList<>(deploymentInstanceSpec.endpoints()); if (newEndpoints.containsAll(endpoints)) return; // Adding new endpoints is fine if (containsAllDestinationsOf(endpoints, newEndpoints)) return; // Adding destinations is fine @@ -255,26 +253,6 @@ public class ApplicationPackageValidator { return containsAllRegions && hasSameCluster; } - /** Returns all configued endpoints of given deployment instance spec */ - private static List allEndpointsOf(DeploymentInstanceSpec deploymentInstanceSpec) { - var endpoints = new ArrayList<>(deploymentInstanceSpec.endpoints()); - legacyEndpoint(deploymentInstanceSpec).ifPresent(endpoints::add); - return endpoints; - } - - /** Returns global service ID as an endpoint, if any global service ID is set */ - private static Optional legacyEndpoint(DeploymentInstanceSpec instance) { - return instance.globalServiceId().map(globalServiceId -> { - var targets = instance.zones().stream() - .filter(zone -> zone.environment().isProduction()) - .flatMap(zone -> zone.region().stream()) - .distinct() - .map(region -> new Endpoint.Target(region, instance.name(), 1)) - .toList(); - return new Endpoint(EndpointId.defaultId().id(), globalServiceId, Endpoint.Level.instance, targets); - }); - } - /** Returns a list of the non-compactable IDs of given instance and endpoint */ private static List nonCompactableIds(InstanceName instance, Endpoint endpoint) { List ids = new ArrayList<>(2); @@ -287,16 +265,6 @@ public class ApplicationPackageValidator { return ids; } - private static class InstanceEndpoint { - - private final InstanceName instance; - private final String endpointId; - - public InstanceEndpoint(InstanceName instance, String endpointId) { - this.instance = instance; - this.endpointId = endpointId; - } - - } + private record InstanceEndpoint(InstanceName instance, String endpointId) {} } 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 a309afcd039..8fae3309f2b 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 @@ -658,10 +658,6 @@ public class RoutingPolicies { if (instanceSpec.isEmpty()) { return Set.of(); } - if (instanceSpec.get().globalServiceId().filter(id -> id.equals(loadBalancer.cluster().value())).isPresent()) { - // Legacy assignment always has the default endpoint ID - return Set.of(EndpointId.defaultId()); - } return instanceSpec.get().endpoints().stream() .filter(endpoint -> endpoint.containerId().equals(loadBalancer.cluster().value())) .filter(endpoint -> endpoint.regions().contains(deployment.zoneId().region())) diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepository.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepository.java index 1e9f11e0349..d54bdead0bd 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepository.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/rotation/RotationRepository.java @@ -1,7 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.routing.rotation; -import com.yahoo.config.application.api.DeploymentInstanceSpec; import com.yahoo.config.application.api.DeploymentSpec; import com.yahoo.config.application.api.Endpoint; import com.yahoo.config.provision.ApplicationId; @@ -62,45 +61,11 @@ public class RotationRepository { return rotation; } - /** - * Returns a single rotation for the given application. This is only used when a rotation is assigned through the - * use of a global service ID. - * - * If a rotation is already assigned to the application, that rotation will be returned. - * If no rotation is assigned, return an available rotation. The caller is responsible for assigning the rotation. - * - * @param instanceSpec the instance deployment spec - * @param instance the instance requesting a rotation - * @param lock lock which must be acquired by the caller - */ - private AssignedRotation assignRotationTo(String globalServiceId, DeploymentInstanceSpec instanceSpec, - Instance instance, RotationLock lock) { - RotationId rotation; - if (instance.rotations().isEmpty()) { - rotation = findAvailableRotation(instance.id(), lock).id(); - } else { - rotation = instance.rotations().get(0).rotationId(); - } - var productionRegions = instanceSpec.zones().stream() - .filter(zone -> zone.environment().isProduction()) - .flatMap(zone -> zone.region().stream()) - .collect(Collectors.toSet()); - if (productionRegions.size() < 2) { - throw new IllegalArgumentException("global-service-id is set but less than 2 prod zones are defined " + - "in instance '" + instance.name() + "'"); - } - return new AssignedRotation(new ClusterSpec.Id(globalServiceId), - EndpointId.defaultId(), - rotation, - productionRegions); - } - /** * Returns rotation assignments for all endpoints in application. * * If rotations are already assigned, these will be returned. * If rotations are not assigned, a new assignment will be created taking new rotations from the repository. - * This method supports both global-service-id as well as the new endpoints tag. * * @param deploymentSpec The deployment spec of the application * @param instance The application requesting rotations @@ -112,19 +77,7 @@ public class RotationRepository { if (allRotations.isEmpty()) { return List.of(); } - - // Only allow one kind of configuration syntax var instanceSpec = deploymentSpec.requireInstance(instance.name()); - if ( instanceSpec.globalServiceId().isPresent() - && ! instanceSpec.endpoints().isEmpty()) { - throw new IllegalArgumentException("Cannot provision rotations with both global-service-id and 'endpoints'"); - } - - // Support legacy global-service-id - if (instanceSpec.globalServiceId().isPresent()) { - return List.of(assignRotationTo(instanceSpec.globalServiceId().get(), instanceSpec, instance, lock)); - } - return assignRotationsTo(instanceSpec.endpoints(), instance, lock); } 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(); @@ -1531,22 +1531,6 @@ public class ControllerTest { assertEquals(Optional.empty(), tester.controllerTester().configServer().cloudAccount(context.deploymentIdIn(prodZone2))); } - @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(); 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(" \n"); }); xml.append(blockChange); - xml.append(" \n"); + xml.append(" \n"); xml.append(prodBody); xml.append(" \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 5df2ce234a1..593d788fd7d 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("\n" + " \n" + " \n" + - " \n" + - " us-west-1\n" + + " \n" + + " us-west-1\n" + " \n" + " \n" + ""); 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": "\n \n \n \n us-east-3\n us-west-1\n \n\n", + "deploymentSpecField": "\n \n \n \n us-east-3\n us-west-1\n \n\n", "validationOverrides": "\n content-cluster-removal\n cluster-size-reduction\n force-automatic-tenant-upgrade-test\n\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 @@ -233,27 +233,6 @@ public class RoutingPoliciesTest { tester.assertTargets(application, endpointId, ClusterSpec.Id.from("c0"), 0, zoneWeights); } - @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); 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") @@ -115,15 +115,6 @@ public class RotationRepositoryTest { .runJobExpectingFailure(DeploymentContext.systemTest, "out of rotations"); } - @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() @@ -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) -- cgit v1.2.3