diff options
author | jonmv <venstad@gmail.com> | 2022-07-05 11:09:45 +0200 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2022-07-05 11:09:45 +0200 |
commit | 4728ecb294c408c6fa887dda5e12e39eb5bc8292 (patch) | |
tree | 6c6771e4ad1deb5c904e85491e90cfab43e4af8a /controller-server/src/main/java/com/yahoo | |
parent | b95b3bdd37693e755341b2ec02077739a9a10962 (diff) |
Only deployment spec major version may force an automatic downgrade
Diffstat (limited to 'controller-server/src/main/java/com/yahoo')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java | 5 |
1 files changed, 4 insertions, 1 deletions
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 389e931fb98..045e43f532c 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 @@ -340,7 +340,10 @@ public class ApplicationController { Version oldestInstalledPlatform = oldestInstalledPlatform(id); // Target platforms are all versions not older than the oldest installed platform, unless forcing a major version change. - Predicate<Version> isTargetPlatform = targetMajor.isEmpty() || targetMajor.getAsInt() == oldestInstalledPlatform.getMajor() + // Only major version specified in deployment spec is enough to force a downgrade, while all sources may force an upgrade. + Predicate<Version> isTargetPlatform = targetMajor.isEmpty() + || targetMajor.getAsInt() == oldestInstalledPlatform.getMajor() + || wantedMajor.isEmpty() && targetMajor.getAsInt() <= oldestInstalledPlatform.getMajor() ? version -> ! version.isBefore(oldestInstalledPlatform) : version -> targetMajor.getAsInt() == version.getMajor(); Set<Version> platformVersions = versionStatus.versions().stream() |