summaryrefslogtreecommitdiffstats
path: root/config-model-api
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2023-07-26 16:23:50 +0200
committerMartin Polden <mpolden@mpolden.no>2023-07-26 16:30:14 +0200
commit8feeba1352d5e24819efe2a43b21368592ecc67a (patch)
treed500b5dfcfc1b3329ea7748ec4f587375593214a /config-model-api
parente3ba83a0fdd1e31036929c172836e9996f79f16d (diff)
Remove active attribute
Diffstat (limited to 'config-model-api')
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java10
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/application/api/xml/DeploymentSpecXmlReader.java14
-rw-r--r--config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecTest.java132
-rw-r--r--config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecWithoutInstanceTest.java96
4 files changed, 104 insertions, 148 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java b/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java
index 797be652ebc..358744d40f7 100644
--- a/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java
+++ b/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.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.collections.Comparables;
import com.yahoo.config.application.api.xml.DeploymentSpecXmlReader;
import com.yahoo.config.provision.AthenzDomain;
@@ -434,17 +433,16 @@ public class DeploymentSpec {
private final Environment environment;
private final Optional<RegionName> region;
- private final boolean active;
private final Optional<AthenzService> athenzService;
private final Optional<String> testerFlavor;
private final Map<CloudName, CloudAccount> cloudAccounts;
private final Optional<Duration> hostTTL;
public DeclaredZone(Environment environment) {
- this(environment, Optional.empty(), false, Optional.empty(), Optional.empty(), Map.of(), Optional.empty());
+ this(environment, Optional.empty(), Optional.empty(), Optional.empty(), Map.of(), Optional.empty());
}
- public DeclaredZone(Environment environment, Optional<RegionName> region, boolean active,
+ public DeclaredZone(Environment environment, Optional<RegionName> region,
Optional<AthenzService> athenzService, Optional<String> testerFlavor,
Map<CloudName, CloudAccount> cloudAccounts, Optional<Duration> hostTTL) {
if (environment != Environment.prod && region.isPresent())
@@ -454,7 +452,6 @@ public class DeploymentSpec {
hostTTL.filter(Duration::isNegative).ifPresent(ttl -> illegal("Host TTL cannot be negative"));
this.environment = Objects.requireNonNull(environment);
this.region = Objects.requireNonNull(region);
- this.active = active;
this.athenzService = Objects.requireNonNull(athenzService);
this.testerFlavor = Objects.requireNonNull(testerFlavor);
this.cloudAccounts = Map.copyOf(cloudAccounts);
@@ -466,9 +463,6 @@ public class DeploymentSpec {
/** The region name, or empty if not declared */
public Optional<RegionName> region() { return region; }
- /** Returns whether this zone should receive production traffic */
- public boolean active() { return active; }
-
public Optional<String> testerFlavor() { return testerFlavor; }
Optional<AthenzService> athenzService() { return athenzService; }
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 13bc09883fa..4bfecabaf69 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
@@ -273,7 +273,7 @@ public class DeploymentSpecXmlReader {
return List.of(new DeclaredTest(RegionName.from(XML.getValue(stepTag).trim()), readHostTTL(stepTag))); // A production test
}
case devTag, perfTag, stagingTag: // Intentional fallthrough from test tag.
- return List.of(new DeclaredZone(Environment.from(stepTag.getTagName()), Optional.empty(), false, athenzService, testerFlavor, readCloudAccounts(stepTag), readHostTTL(stepTag)));
+ return List.of(new DeclaredZone(Environment.from(stepTag.getTagName()), Optional.empty(), athenzService, testerFlavor, readCloudAccounts(stepTag), readHostTTL(stepTag)));
case prodTag: // regions, delay and parallel may be nested within, but we can flatten them
return XML.getChildren(stepTag).stream()
.flatMap(child -> readNonInstanceSteps(child, prodAttributes, stepTag, defaultBcp).stream())
@@ -682,7 +682,7 @@ public class DeploymentSpecXmlReader {
private DeclaredZone readDeclaredZone(Environment environment, Optional<AthenzService> athenzService,
Optional<String> testerFlavor, Element regionTag) {
return new DeclaredZone(environment, Optional.of(RegionName.from(XML.getValue(regionTag).trim())),
- readActive(regionTag), athenzService, testerFlavor,
+ athenzService, testerFlavor,
readCloudAccounts(regionTag), readHostTTL(regionTag));
}
@@ -784,16 +784,6 @@ public class DeploymentSpecXmlReader {
};
}
- private boolean readActive(Element regionTag) {
- String activeValue = regionTag.getAttribute("active");
- if ("".equals(activeValue)) return true; // Default to active
- deprecate(regionTag, List.of("active"), 7, "See https://cloud.vespa.ai/en/reference/routing#deprecated-syntax");
- if ("true".equals(activeValue)) return true;
- if ("false".equals(activeValue)) return false;
- throw new IllegalArgumentException("Value of 'active' attribute in region tag must be 'true' or 'false' " +
- "to control whether this region should receive traffic from the global endpoint of this application");
- }
-
private void deprecate(Element element, List<String> attributes, int majorVersion, String message) {
deprecatedElements.add(new DeprecatedElement(majorVersion, element.getTagName(), attributes, message));
}
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 c33277dfc6f..134d45e35ab 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
@@ -116,8 +116,8 @@ public class DeploymentSpecTest {
<deployment version='1.0'>
<instance id='default'>
<prod>
- <region active='false'>us-east1</region>
- <region active='true'>us-west1</region>
+ <region>us-east1</region>
+ <region>us-west1</region>
</prod>
</instance>
</deployment>
@@ -128,10 +128,8 @@ public class DeploymentSpecTest {
assertEquals(2, spec.requireInstance("default").steps().size());
assertTrue(spec.requireInstance("default").steps().get(0).concerns(prod, Optional.of(RegionName.from("us-east1"))));
- assertFalse(((DeploymentSpec.DeclaredZone)spec.requireInstance("default").steps().get(0)).active());
assertTrue(spec.requireInstance("default").steps().get(1).concerns(prod, Optional.of(RegionName.from("us-west1"))));
- assertTrue(((DeploymentSpec.DeclaredZone)spec.requireInstance("default").steps().get(1)).active());
assertFalse(spec.requireInstance("default").concerns(test, Optional.empty()));
assertFalse(spec.requireInstance("default").concerns(staging, Optional.empty()));
@@ -154,14 +152,14 @@ public class DeploymentSpecTest {
"<deployment version='1.0'>" +
" <instance id='a' tags='tag1 tag2'>" +
" <prod>" +
- " <region active='false'>us-east1</region>" +
- " <region active='true'>us-west1</region>" +
+ " <region>us-east1</region>" +
+ " <region>us-west1</region>" +
" </prod>" +
" </instance>" +
" <instance id='b' tags='tag3'>" +
" <prod>" +
- " <region active='false'>us-east1</region>" +
- " <region active='true'>us-west1</region>" +
+ " <region>us-east1</region>" +
+ " <region>us-west1</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -179,9 +177,9 @@ public class DeploymentSpecTest {
" <test/>" +
" <staging/>" +
" <prod>" +
- " <region active='false'>us-east1</region>" +
+ " <region>us-east1</region>" +
" <delay hours='3' minutes='30'/>" +
- " <region active='true'>us-west1</region>" +
+ " <region>us-west1</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -199,8 +197,8 @@ public class DeploymentSpecTest {
" <test/>" +
" <staging/>" +
" <prod>" +
- " <region active='false'>us-east-1</region>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-east-1</region>" +
+ " <region>us-west-1</region>" +
" <delay hours='1' />" +
" <test>us-west-1</test>" +
" <test>us-east-1</test>" +
@@ -227,7 +225,7 @@ public class DeploymentSpecTest {
"<deployment version='1.0'>" +
" <instance id='default'>" +
" <prod>" +
- " <region active='true'>us-east1</region>" +
+ " <region>us-east1</region>" +
" <test>us-east1</test>" +
" <test>us-east1</test>" +
" </prod>" +
@@ -244,7 +242,7 @@ public class DeploymentSpecTest {
" <instance id='default'>" +
" <prod>" +
" <test>us-east1</test>" +
- " <region active='true'>us-east1</region>" +
+ " <region>us-east1</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -259,7 +257,7 @@ public class DeploymentSpecTest {
" <instance id='default'>" +
" <prod>" +
" <parallel>" +
- " <region active='true'>us-east1</region>" +
+ " <region>us-east1</region>" +
" <test>us-east1</test>" +
" </parallel>" +
" </prod>" +
@@ -277,14 +275,14 @@ public class DeploymentSpecTest {
" <test/>" +
" <staging/>" +
" <prod>" +
- " <region active='false'>us-east1</region>" +
+ " <region>us-east1</region>" +
" <delay hours='3' minutes='30'/>" +
- " <region active='true'>us-west1</region>" +
+ " <region>us-west1</region>" +
" </prod>" +
" </instance>" +
" <instance id='instance2'>" +
" <prod>" +
- " <region active='true'>us-central1</region>" +
+ " <region>us-central1</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -309,9 +307,9 @@ public class DeploymentSpecTest {
" <test/>" +
" <staging/>" +
" <prod>" +
- " <region active='false'>us-east1</region>" +
+ " <region>us-east1</region>" +
" <delay hours='3' minutes='30'/>" +
- " <region active='true'>us-west1</region>" +
+ " <region>us-west1</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -332,13 +330,11 @@ public class DeploymentSpecTest {
assertTrue(instance.steps().get(1).concerns(staging));
assertTrue(instance.steps().get(2).concerns(prod, Optional.of(RegionName.from("us-east1"))));
- assertFalse(((DeploymentSpec.DeclaredZone)instance.steps().get(2)).active());
assertTrue(instance.steps().get(3) instanceof DeploymentSpec.Delay);
assertEquals(3 * 60 * 60 + 30 * 60, instance.steps().get(3).delay().getSeconds());
assertTrue(instance.steps().get(4).concerns(prod, Optional.of(RegionName.from("us-west1"))));
- assertTrue(((DeploymentSpec.DeclaredZone)instance.steps().get(4)).active());
assertTrue(instance.concerns(test, Optional.empty()));
assertTrue(instance.concerns(test, Optional.of(RegionName.from("region1")))); // test steps specify no region
@@ -474,11 +470,11 @@ public class DeploymentSpecTest {
" <instance id='default'>" +
" <upgrade policy='canary'/>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" <delay hours='47'/>" +
- " <region active='true'>us-central-1</region>" +
+ " <region>us-central-1</region>" +
" <delay minutes='59' seconds='61'/>" +
- " <region active='true'>us-east-3</region>" +
+ " <region>us-east-3</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -515,10 +511,10 @@ public class DeploymentSpecTest {
"<deployment>" +
" <instance id='default'>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" <parallel>" +
- " <region active='true'>us-central-1</region>" +
- " <region active='true'>us-east-3</region>" +
+ " <region>us-central-1</region>" +
+ " <region>us-east-3</region>" +
" </parallel>" +
" </prod>" +
" </instance>" +
@@ -539,14 +535,14 @@ public class DeploymentSpecTest {
" <staging/>" +
" <instance id='instance0'>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" </prod>" +
" </instance>" +
" <instance id='instance1'>" +
" <test/>" +
" <staging/>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -579,25 +575,25 @@ public class DeploymentSpecTest {
" <instance id='instance' athenz-service='in-service'>" +
" <prod>" +
" <parallel>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" <steps>" +
- " <region active='true'>us-east-3</region>" +
+ " <region>us-east-3</region>" +
" <delay hours='2' />" +
- " <region active='true'>eu-west-1</region>" +
+ " <region>eu-west-1</region>" +
" <delay hours='2' />" +
" </steps>" +
" <steps>" +
" <delay hours='3' />" +
- " <region active='true'>aws-us-east-1a</region>" +
+ " <region>aws-us-east-1a</region>" +
" <parallel>" +
- " <region active='true' athenz-service='no-service'>ap-northeast-1</region>" +
- " <region active='true'>ap-southeast-2</region>" +
+ " <region athenz-service='no-service'>ap-northeast-1</region>" +
+ " <region>ap-southeast-2</region>" +
" <test>aws-us-east-1a</test>" +
" </parallel>" +
" </steps>" +
" <delay hours='3' minutes='30' />" +
" </parallel>" +
- " <region active='true'>us-north-7</region>" +
+ " <region>us-north-7</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -651,12 +647,12 @@ public class DeploymentSpecTest {
" <parallel>" +
" <instance id='instance0'>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" </prod>" +
" </instance>" +
" <instance id='instance1'>" +
" <prod>" +
- " <region active='true'>us-east-3</region>" +
+ " <region>us-east-3</region>" +
" </prod>" +
" </instance>" +
" </parallel>" +
@@ -679,13 +675,13 @@ public class DeploymentSpecTest {
"<deployment>" +
" <instance id='instance0'>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" </prod>" +
" </instance>" +
" <delay hours='12'/>" +
" <instance id='instance1'>" +
" <prod>" +
- " <region active='true'>us-east-3</region>" +
+ " <region>us-east-3</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -705,11 +701,11 @@ public class DeploymentSpecTest {
"<deployment>" +
" <instance id='default'>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" <parallel>" +
- " <region active='true'>us-west-1</region>" +
- " <region active='true'>us-central-1</region>" +
- " <region active='true'>us-east-3</region>" +
+ " <region>us-west-1</region>" +
+ " <region>us-central-1</region>" +
+ " <region>us-east-3</region>" +
" </parallel>" +
" </prod>" +
" </instance>" +
@@ -796,7 +792,7 @@ public class DeploymentSpecTest {
" <instance id='default'>" +
" <block-change days='sat' hours='10' time-zone='CET'/>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" </prod>" +
" <block-change days='mon,tue' hours='15-16'/>" +
" </instance>" +
@@ -813,7 +809,7 @@ public class DeploymentSpecTest {
" <block-change days='sat' hours='10' time-zone='CET'/>" +
" <test/>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -830,7 +826,7 @@ public class DeploymentSpecTest {
" <block-change days='sat' hours='10' time-zone='CET'/>" +
" <block-change days='mon-sun' hours='0-23' time-zone='CET' from-date='2022-01-01' to-date='2022-01-15'/>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -891,7 +887,7 @@ public class DeploymentSpecTest {
"<deployment athenz-domain='domain' athenz-service='service'>" +
" <instance id='instance1'>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -909,10 +905,10 @@ public class DeploymentSpecTest {
"<deployment athenz-domain='domain' athenz-service='service'>" +
" <instance id='instance1'>" +
" <prod athenz-service='prod-service'>" +
- " <region active='true'>us-central-1</region>" +
+ " <region>us-central-1</region>" +
" <parallel>" +
- " <region active='true'>us-west-1</region>" +
- " <region active='true'>us-east-3</region>" +
+ " <region>us-west-1</region>" +
+ " <region>us-east-3</region>" +
" </parallel>" +
" </prod>" +
" </instance>" +
@@ -939,16 +935,16 @@ public class DeploymentSpecTest {
<instance id='instance1'>
<prod>
<parallel>
- <region active='true'>us-west-1</region>
- <region active='true'>us-east-3</region>
+ <region>us-west-1</region>
+ <region>us-east-3</region>
</parallel>
</prod>
</instance>
<instance id='instance2'>
<prod>
<parallel>
- <region active='true'>us-west-1</region>
- <region active='true'>us-east-3</region>
+ <region>us-west-1</region>
+ <region>us-east-3</region>
</parallel>
</prod>
</instance>
@@ -971,7 +967,7 @@ public class DeploymentSpecTest {
"<deployment athenz-domain='domain'>" +
" <instance id='default' athenz-service='service'>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -990,7 +986,7 @@ public class DeploymentSpecTest {
" <test />" +
" <staging athenz-service='staging-service' />" +
" <prod athenz-service='prod-service'>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -1013,7 +1009,7 @@ public class DeploymentSpecTest {
"<deployment athenz-domain='domain'>" +
" <instance id='default'>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -1027,7 +1023,7 @@ public class DeploymentSpecTest {
"<deployment>" +
" <instance id='default'>" +
" <prod athenz-service='service'>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" </prod>" +
" </instance>" +
"</deployment>"
@@ -1356,14 +1352,14 @@ public class DeploymentSpecTest {
<deployment>
<instance id="beta">
<prod>
- <region active='true'>us-west-1</region>
- <region active='true'>us-east-3</region>
+ <region>us-west-1</region>
+ <region>us-east-3</region>
</prod>
</instance>
<instance id="main">
<prod>
- <region active='true'>us-west-1</region>
- <region active='true'>us-east-3</region>
+ <region>us-west-1</region>
+ <region>us-east-3</region>
</prod>
</instance>
<endpoints>
@@ -1456,14 +1452,14 @@ public class DeploymentSpecTest {
<deployment>
<instance id="beta">
<prod>
- <region active='true'>us-west-1</region>
- <region active='true'>us-east-3</region>
+ <region>us-west-1</region>
+ <region>us-east-3</region>
</prod>
</instance>
<instance id="main">
<prod>
- <region active='true'>us-west-1</region>
- <region active='true'>us-east-3</region>
+ <region>us-west-1</region>
+ <region>us-east-3</region>
</prod>
<endpoints>
<endpoint id="glob" container-id="music"/>
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 a8c3913c498..3a8d7ae1703 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
@@ -96,8 +96,8 @@ public class DeploymentSpecWithoutInstanceTest {
StringReader r = new StringReader(
"<deployment version='1.0'>" +
" <prod>" +
- " <region active='false'>us-east1</region>" +
- " <region active='true'>us-west1</region>" +
+ " <region>us-east1</region>" +
+ " <region>us-west1</region>" +
" </prod>" +
"</deployment>"
);
@@ -107,10 +107,8 @@ public class DeploymentSpecWithoutInstanceTest {
assertEquals(2, spec.requireInstance("default").steps().size());
assertTrue(spec.requireInstance("default").steps().get(0).concerns(prod, Optional.of(RegionName.from("us-east1"))));
- assertFalse(((DeploymentSpec.DeclaredZone)spec.requireInstance("default").steps().get(0)).active());
assertTrue(spec.requireInstance("default").steps().get(1).concerns(prod, Optional.of(RegionName.from("us-west1"))));
- assertTrue(((DeploymentSpec.DeclaredZone)spec.requireInstance("default").steps().get(1)).active());
assertFalse(spec.requireInstance("default").concerns(test, Optional.empty()));
assertFalse(spec.requireInstance("default").concerns(Environment.staging, Optional.empty()));
@@ -129,9 +127,9 @@ public class DeploymentSpecWithoutInstanceTest {
" <test/>" +
" <staging/>" +
" <prod>" +
- " <region active='false'>us-east1</region>" +
+ " <region>us-east1</region>" +
" <delay hours='3' minutes='30'/>" +
- " <region active='true'>us-west1</region>" +
+ " <region>us-west1</region>" +
" </prod>" +
"</deployment>"
);
@@ -145,13 +143,11 @@ public class DeploymentSpecWithoutInstanceTest {
assertTrue(spec.requireInstance("default").steps().get(1).concerns(Environment.staging));
assertTrue(spec.requireInstance("default").steps().get(2).concerns(prod, Optional.of(RegionName.from("us-east1"))));
- assertFalse(((DeploymentSpec.DeclaredZone)spec.requireInstance("default").steps().get(2)).active());
assertTrue(spec.requireInstance("default").steps().get(3) instanceof DeploymentSpec.Delay);
assertEquals(3 * 60 * 60 + 30 * 60, spec.requireInstance("default").steps().get(3).delay().getSeconds());
assertTrue(spec.requireInstance("default").steps().get(4).concerns(prod, Optional.of(RegionName.from("us-west1"))));
- assertTrue(((DeploymentSpec.DeclaredZone)spec.requireInstance("default").steps().get(4)).active());
assertTrue(spec.requireInstance("default").concerns(test, Optional.empty()));
assertTrue(spec.requireInstance("default").concerns(test, Optional.of(RegionName.from("region1")))); // test steps specify no region
@@ -168,8 +164,8 @@ public class DeploymentSpecWithoutInstanceTest {
" <test/>" +
" <staging/>" +
" <prod>" +
- " <region active='false'>us-east-1</region>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-east-1</region>" +
+ " <region>us-west-1</region>" +
" <delay hours='1' />" +
" <test>us-west-1</test>" +
" <test>us-east-1</test>" +
@@ -194,7 +190,7 @@ public class DeploymentSpecWithoutInstanceTest {
StringReader r = new StringReader(
"<deployment version='1.0'>" +
" <prod>" +
- " <region active='true'>us-east1</region>" +
+ " <region>us-east1</region>" +
" <test>us-east1</test>" +
" <test>us-east1</test>" +
" </prod>" +
@@ -209,7 +205,7 @@ public class DeploymentSpecWithoutInstanceTest {
"<deployment version='1.0'>" +
" <prod>" +
" <test>us-east1</test>" +
- " <region active='true'>us-east1</region>" +
+ " <region>us-east1</region>" +
" </prod>" +
"</deployment>"
);
@@ -222,7 +218,7 @@ public class DeploymentSpecWithoutInstanceTest {
"<deployment version='1.0'>" +
" <prod>" +
" <parallel>" +
- " <region active='true'>us-east1</region>" +
+ " <region>us-east1</region>" +
" <test>us-east1</test>" +
" </parallel>" +
" </prod>" +
@@ -231,26 +227,6 @@ public class DeploymentSpecWithoutInstanceTest {
DeploymentSpec.fromXml(r);
}
- @Test(expected=IllegalArgumentException.class)
- public void globalServiceIdInTest() {
- StringReader r = new StringReader(
- "<deployment version='1.0'>" +
- " <test global-service-id='query' />" +
- "</deployment>"
- );
- DeploymentSpec.fromXml(r);
- }
-
- @Test(expected=IllegalArgumentException.class)
- public void globalServiceIdInStaging() {
- StringReader r = new StringReader(
- "<deployment version='1.0'>" +
- " <staging global-service-id='query' />" +
- "</deployment>"
- );
- DeploymentSpec.fromXml(r);
- }
-
@Test
public void productionSpecWithUpgradeRollout() {
StringReader r = new StringReader(
@@ -280,11 +256,11 @@ public class DeploymentSpecWithoutInstanceTest {
"<deployment>" +
" <upgrade policy='canary'/>" +
" <prod>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" <delay hours='47'/>" +
- " <region active='true'>us-central-1</region>" +
+ " <region>us-central-1</region>" +
" <delay minutes='59' seconds='61'/>" +
- " <region active='true'>us-east-3</region>" +
+ " <region>us-east-3</region>" +
" </prod>" +
"</deployment>"
);
@@ -323,10 +299,10 @@ public class DeploymentSpecWithoutInstanceTest {
StringReader r = new StringReader(
"<deployment>\n" +
" <prod> \n" +
- " <region active='true'>us-west-1</region>\n" +
+ " <region>us-west-1</region>\n" +
" <parallel>\n" +
- " <region active='true'>us-central-1</region>\n" +
- " <region active='true'>us-east-3</region>\n" +
+ " <region>us-central-1</region>\n" +
+ " <region>us-east-3</region>\n" +
" </parallel>\n" +
" </prod>\n" +
"</deployment>"
@@ -345,25 +321,25 @@ public class DeploymentSpecWithoutInstanceTest {
" <staging />" +
" <prod>" +
" <parallel>" +
- " <region active='true'>us-west-1</region>" +
+ " <region>us-west-1</region>" +
" <steps>" +
- " <region active='true'>us-east-3</region>" +
+ " <region>us-east-3</region>" +
" <delay hours='2' />" +
- " <region active='true'>eu-west-1</region>" +
+ " <region>eu-west-1</region>" +
" <delay hours='2' />" +
" </steps>" +
" <steps>" +
" <delay hours='3' />" +
- " <region active='true'>aws-us-east-1a</region>" +
+ " <region>aws-us-east-1a</region>" +
" <parallel>" +
- " <region active='true' athenz-service='no-service'>ap-northeast-1</region>" +
- " <region active='true'>ap-southeast-2</region>" +
+ " <region athenz-service='no-service'>ap-northeast-1</region>" +
+ " <region>ap-southeast-2</region>" +
" <test>aws-us-east-1a</test>" +
" </parallel>" +
" </steps>" +
" <delay hours='3' minutes='30' />" +
" </parallel>" +
- " <region active='true'>us-north-7</region>" +
+ " <region>us-north-7</region>" +
" </prod>" +
"</deployment>"
);
@@ -414,11 +390,11 @@ public class DeploymentSpecWithoutInstanceTest {
StringReader r = new StringReader(
"<deployment>\n" +
" <prod>\n" +
- " <region active='true'>us-west-1</region>\n" +
+ " <region>us-west-1</region>\n" +
" <parallel>\n" +
- " <region active='true'>us-west-1</region>\n" +
- " <region active='true'>us-central-1</region>\n" +
- " <region active='true'>us-east-3</region>\n" +
+ " <region>us-west-1</region>\n" +
+ " <region>us-central-1</region>\n" +
+ " <region>us-east-3</region>\n" +
" </parallel>\n" +
" </prod>\n" +
"</deployment>"
@@ -437,7 +413,7 @@ public class DeploymentSpecWithoutInstanceTest {
"<deployment>\n" +
" <block-change days='sat' hours='10' time-zone='CET'/>\n" +
" <prod>\n" +
- " <region active='true'>us-west-1</region>\n" +
+ " <region>us-west-1</region>\n" +
" </prod>\n" +
" <block-change days='mon,tue' hours='15-16'/>\n" +
"</deployment>"
@@ -452,7 +428,7 @@ public class DeploymentSpecWithoutInstanceTest {
" <block-change days='sat' hours='10' time-zone='CET'/>\n" +
" <test/>\n" +
" <prod>\n" +
- " <region active='true'>us-west-1</region>\n" +
+ " <region>us-west-1</region>\n" +
" </prod>\n" +
"</deployment>"
);
@@ -466,7 +442,7 @@ public class DeploymentSpecWithoutInstanceTest {
" <block-change revision='false' days='mon,tue' hours='15-16'/>\n" +
" <block-change days='sat' hours='10' time-zone='CET'/>\n" +
" <prod>\n" +
- " <region active='true'>us-west-1</region>\n" +
+ " <region>us-west-1</region>\n" +
" </prod>\n" +
"</deployment>"
);
@@ -495,7 +471,7 @@ public class DeploymentSpecWithoutInstanceTest {
StringReader r = new StringReader(
"<deployment athenz-domain='domain' athenz-service='service'>\n" +
" <prod>\n" +
- " <region active='true'>us-west-1</region>\n" +
+ " <region>us-west-1</region>\n" +
" </prod>\n" +
"</deployment>"
);
@@ -509,10 +485,10 @@ public class DeploymentSpecWithoutInstanceTest {
StringReader r = new StringReader(
"<deployment athenz-domain='domain' athenz-service='service'>" +
" <prod athenz-service='prod-service'>" +
- " <region active='true'>us-central-1</region>" +
+ " <region>us-central-1</region>" +
" <parallel>" +
- " <region active='true'>us-west-1</region>" +
- " <region active='true'>us-east-3</region>" +
+ " <region>us-west-1</region>" +
+ " <region>us-east-3</region>" +
" </parallel>" +
" </prod>" +
"</deployment>"
@@ -535,7 +511,7 @@ public class DeploymentSpecWithoutInstanceTest {
" <test />\n" +
" <staging athenz-service='staging-service' />\n" +
" <prod athenz-service='prod-service'>\n" +
- " <region active='true'>us-west-1</region>\n" +
+ " <region>us-west-1</region>\n" +
" </prod>\n" +
"</deployment>"
);
@@ -552,7 +528,7 @@ public class DeploymentSpecWithoutInstanceTest {
StringReader r = new StringReader(
"<deployment athenz-domain='domain'>\n" +
" <prod>\n" +
- " <region active='true'>us-west-1</region>\n" +
+ " <region>us-west-1</region>\n" +
" </prod>\n" +
"</deployment>"
);
@@ -564,7 +540,7 @@ public class DeploymentSpecWithoutInstanceTest {
StringReader r = new StringReader(
"<deployment>\n" +
" <prod athenz-service='service'>\n" +
- " <region active='true'>us-west-1</region>\n" +
+ " <region>us-west-1</region>\n" +
" </prod>\n" +
"</deployment>"
);