summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2022-08-18 15:25:09 +0200
committerjonmv <venstad@gmail.com>2022-08-18 15:25:09 +0200
commit97e98d75df02fa94c3024d079e88967db4cd60eb (patch)
tree41d4d818476d85a1c48e0294041e55c2c4a3567e /controller-server
parent867d42fca4a37e0b0e017b766a74e4fa78217d29 (diff)
Avoid scheduling an upgrade to a platform with which no known build is compatible
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/InstanceList.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/InstanceList.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/InstanceList.java
index 6178bfbb89e..153ce87ff6b 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/InstanceList.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/InstanceList.java
@@ -36,14 +36,19 @@ public class InstanceList extends AbstractFilteringList<ApplicationId, InstanceL
}
/**
- * Returns the subset of instances where all production deployments are compatible with the given version.
+ * Returns the subset of instances where all production deployments are compatible with the given version,
+ * and at least one known build is compatible with the given version.
*
* @param platform the version which applications returned are compatible with
*/
public InstanceList compatibleWithPlatform(Version platform, Function<ApplicationId, VersionCompatibility> compatibility) {
- return matching(id -> instance(id).productionDeployments().values().stream()
- .flatMap(deployment -> application(id).revisions().get(deployment.revision()).compileVersion().stream())
- .noneMatch(version -> compatibility.apply(id).refuse(platform, version)));
+ return matching(id -> instance(id).productionDeployments().values().stream()
+ .flatMap(deployment -> application(id).revisions().get(deployment.revision()).compileVersion().stream())
+ .noneMatch(version -> compatibility.apply(id).refuse(platform, version))
+ && application(id).revisions().production().stream()
+ .anyMatch(revision -> revision.compileVersion()
+ .map(compiled -> compatibility.apply(id).accept(platform, compiled))
+ .orElse(true)));
}
/**