From a7c1c1a1970c7d9f89cafe5d60692e89ae505419 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Tue, 22 Jan 2019 09:41:29 +0100 Subject: Deployment spec majorVersion take precedence over Application value Overriding the major version set in the deployment spec does not work because config servers will filter out major versions based on the deployment spec, and it is not useful because we should respect applications explicit choices when specified. --- .../src/main/java/com/yahoo/vespa/hosted/controller/Application.java | 5 ++--- .../yahoo/vespa/hosted/controller/application/ApplicationList.java | 2 +- 2 files changed, 3 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 82355144b20..963dca8d3b5 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 @@ -153,9 +153,8 @@ public class Application { } /** - * Overrides the preferred major version for this application. - * This overrides the major version set in the deployment spec (if any) and the major version the system - * wants to use. + * Overrides the system major version for this application. This override takes effect if the deployment + * spec does not specify a major version. */ public Optional majorVersion() { return majorVersion; } diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/ApplicationList.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/ApplicationList.java index ca6fa083f1b..a3fd0087662 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/ApplicationList.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/ApplicationList.java @@ -166,7 +166,7 @@ public class ApplicationList { * @param defaultMajorVersion the default major version to assume for applications not specifying one */ public ApplicationList allowMajorVersion(int targetMajorVersion, int defaultMajorVersion) { - return listOf(list.stream().filter(a -> a.majorVersion().orElse(a.deploymentSpec().majorVersion().orElse(defaultMajorVersion)) + return listOf(list.stream().filter(a -> a.deploymentSpec().majorVersion().orElse(a.majorVersion().orElse(defaultMajorVersion)) >= targetMajorVersion)); } -- cgit v1.2.3