summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorJon Marius Venstad <jvenstad@yahoo-inc.com>2018-04-10 11:42:15 +0200
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2018-04-10 11:42:15 +0200
commitd1a7990045eaf13d56218cabdd51d84e9e9d1cdf (patch)
tree60665facc8fb9c71df315e6c2ed4e46d53368451 /controller-server
parentf02a61c098d240469a80980e3f70061b85a9b9c8 (diff)
Add and remove a TODO
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Application.java3
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java5
2 files changed, 4 insertions, 4 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Application.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Application.java
index 32503aec4d4..ffda9b7ddc2 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Application.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/Application.java
@@ -151,7 +151,7 @@ public class Application {
/** Returns the version a new deployment to this zone should use for this application */
public Version deployVersionIn(ZoneId zone, Controller controller) {
Version current = versionIn(zone, controller);
- return change.platform().filter(version -> ! current.isAfter(version)).orElse(current);
+ return change.platform().filter(ignored -> change.downgrades(current)).orElse(current);
}
/** Returns the current version this application has, or if none; should use, in the given zone */
@@ -162,6 +162,7 @@ public class Application {
/** Returns the Vespa version to use for the given job */
public Version deployVersionFor(DeploymentJobs.JobType jobType, Controller controller) {
+ // TODO jvenstad: Eliminate this and its sibling for component.
return jobType == DeploymentJobs.JobType.component
? controller.systemVersion()
: deployVersionIn(jobType.zone(controller.system()).get(), controller);
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
index 8d231e150e8..8ab69eff5c4 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
@@ -637,7 +637,7 @@ public class ApplicationController {
deploymentSpec.zones().stream()
.filter(zone -> zone.environment() == Environment.prod)
.forEach(zone -> {
- if (!controller.zoneRegistry().hasZone(ZoneId.from(zone.environment(),
+ if ( ! controller.zoneRegistry().hasZone(ZoneId.from(zone.environment(),
zone.region().orElse(null)))) {
throw new IllegalArgumentException("Zone " + zone + " in deployment spec was not found in " +
"this system!");
@@ -647,8 +647,7 @@ public class ApplicationController {
/** Verify that change is tested and that we aren't downgrading */
private void validateChange(Application application, ZoneId zone, Version version) {
- // TODO jvenstad: Hmmm ... Make it possible to deploy only the legal parts of the Change.
- if (!application.deploymentJobs().isDeployableTo(zone.environment(), application.change())) {
+ if ( ! application.deploymentJobs().isDeployableTo(zone.environment(), application.change())) {
throw new IllegalArgumentException("Rejecting deployment of " + application + " to " + zone +
" as " + application.change() + " is not tested");
}