diff options
Diffstat (limited to 'config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java')
-rw-r--r-- | config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java | 31 |
1 files changed, 12 insertions, 19 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 ea7df677e0f..6440b8f893c 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 @@ -75,14 +75,14 @@ public class DeploymentSpec { List<Step> steps = new ArrayList<>(inputSteps); // Add staging if required and missing - if (steps.stream().anyMatch(step -> step.deploysTo(Environment.prod)) && - steps.stream().noneMatch(step -> step.deploysTo(Environment.staging))) { + if (steps.stream().anyMatch(step -> step.concerns(Environment.prod)) && + steps.stream().noneMatch(step -> step.concerns(Environment.staging))) { steps.add(new DeploymentSpec.DeclaredZone(Environment.staging)); } // Add test if required and missing - if (steps.stream().anyMatch(step -> step.deploysTo(Environment.staging)) && - steps.stream().noneMatch(step -> step.deploysTo(Environment.test))) { + if (steps.stream().anyMatch(step -> step.concerns(Environment.staging)) && + steps.stream().noneMatch(step -> step.concerns(Environment.test))) { steps.add(new DeploymentSpec.DeclaredZone(Environment.test)); } @@ -162,13 +162,6 @@ public class DeploymentSpec { // to have environment, instance or region variants on those. public Optional<AthenzService> athenzService() { return this.athenzService; } - // TODO remove when 7.135 is the oldest version - public Optional<AthenzService> athenzService(InstanceName instanceName, Environment environment, RegionName region) { - Optional<DeploymentInstanceSpec> instance = instance(instanceName); - if (instance.isEmpty()) return this.athenzService; - return instance.get().athenzService(environment, region).or(() -> this.athenzService); - } - /** Returns the XML form of this spec, or null if it was not created by fromXml, nor is empty */ public String xmlForm() { return xmlForm; } @@ -272,13 +265,13 @@ public class DeploymentSpec { /** A deployment step */ public abstract static class Step { - /** Returns whether this step deploys to the given region */ - public final boolean deploysTo(Environment environment) { - return deploysTo(environment, Optional.empty()); + /** Returns whether this step specifies the given environment */ + public final boolean concerns(Environment environment) { + return concerns(environment, Optional.empty()); } - /** Returns whether this step deploys to the given environment, and (if specified) region */ - public abstract boolean deploysTo(Environment environment, Optional<RegionName> region); + /** Returns whether this step specifies the given environment, and (optionally) region */ + public abstract boolean concerns(Environment environment, Optional<RegionName> region); /** Returns the zones deployed to in this step */ public List<DeclaredZone> zones() { return Collections.emptyList(); } @@ -304,7 +297,7 @@ public class DeploymentSpec { public Duration delay() { return duration; } @Override - public boolean deploysTo(Environment environment, Optional<RegionName> region) { return false; } + public boolean concerns(Environment environment, Optional<RegionName> region) { return false; } @Override public String toString() { @@ -406,8 +399,8 @@ public class DeploymentSpec { public List<Step> steps() { return steps; } @Override - public boolean deploysTo(Environment environment, Optional<RegionName> region) { - return steps().stream().anyMatch(zone -> zone.deploysTo(environment, region)); + public boolean concerns(Environment environment, Optional<RegionName> region) { + return steps().stream().anyMatch(zone -> zone.concerns(environment, region)); } @Override |