summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2022-03-14 18:47:52 +0100
committerJon Marius Venstad <venstad@gmail.com>2022-03-14 18:47:52 +0100
commit5aed4a7980c1ba8e86ef361cf117718c0a74ebb7 (patch)
tree9fced583f31b89db5e922f88719e8ccef336eaf2
parent67be6e1ab27b5b2d51a6f68d394161501c14b02d (diff)
Refuse to start jobs with incompatible version pairs
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
index 3cc08fb9f52..abd5ca8891a 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobController.java
@@ -496,6 +496,12 @@ public class JobController {
/** Orders a run of the given type, or throws an IllegalStateException if that job type is already running. */
public void start(ApplicationId id, JobType type, Versions versions, boolean isRedeployment, JobProfile profile, Optional<String> reason) {
+ if (versions.targetApplication().compileVersion()
+ .map(version -> controller.applications().versionCompatibility().refuse(versions.targetPlatform(), version))
+ .orElse(false))
+ throw new IllegalArgumentException("Will not start a job with incompatible platform version (" + versions.targetPlatform() + ") " +
+ "and compile versions (" + versions.targetApplication().compileVersion().get() + ")");
+
locked(id, type, __ -> {
Optional<Run> last = last(id, type);
if (last.flatMap(run -> active(run.id())).isPresent())