diff options
author | Martin Polden <mpolden@mpolden.no> | 2023-07-26 16:23:50 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2023-07-27 13:17:42 +0200 |
commit | 60f174c4f1a19a94ba896c4bad7a6df91198c78e (patch) | |
tree | c921accbcf27cf83c7ff77f4e77e91ca22c84c80 /config-model-api/src/main | |
parent | abc51d778d3f370e04cf79d649db59cc3e596449 (diff) |
Remove active attribute
Diffstat (limited to 'config-model-api/src/main')
2 files changed, 4 insertions, 20 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)); } |