diff options
author | Jon Bratseth <bratseth@oath.com> | 2019-01-22 09:41:29 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2019-01-22 09:41:29 +0100 |
commit | a7c1c1a1970c7d9f89cafe5d60692e89ae505419 (patch) | |
tree | e3403b29e1353df7844265e5bab99c01123dcd39 | |
parent | 8372a883c5a5fa100f88fc9b80824359b5bb70cd (diff) |
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.
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<Integer> 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)); } |