diff options
author | Harald Musum <musum@verizonmedia.com> | 2019-10-29 11:32:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-29 11:32:27 +0100 |
commit | dd744c7e23f18b41367d70afa6c5fcad4df19830 (patch) | |
tree | 381cdfd325bd7c8dd7fd31f1bb63399a5e7849dc /controller-server/src/main | |
parent | f7dbaaf6208a6d7d565cb376093a12ecf619f6d0 (diff) |
Revert "Store commit details of latest version"
Diffstat (limited to 'controller-server/src/main')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/VersionStatus.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/VersionStatus.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/VersionStatus.java index 97506d3f6ea..ab445de5a7f 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/VersionStatus.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/VersionStatus.java @@ -99,6 +99,11 @@ public class VersionStatus { } infrastructureVersions.putAll(systemApplicationVersions.asVersionMap()); + // The controller version is the lowest controller version of all controllers + ControllerVersion controllerVersion = controllerVersions.keySet().stream() + .min(Comparator.naturalOrder()) + .get(); + // The system version is the oldest infrastructure version, if that version is newer than the current system // version Version newSystemVersion = infrastructureVersions.keySet().stream().min(Comparator.naturalOrder()).get(); @@ -129,7 +134,7 @@ public class VersionStatus { try { boolean isReleased = Collections.binarySearch(releasedVersions, statistics.version()) >= 0; VespaVersion vespaVersion = createVersion(statistics, - controllerVersions.keySet(), + controllerVersion, systemVersion, isReleased, systemApplicationVersions.matching(statistics.version()), @@ -235,13 +240,11 @@ public class VersionStatus { } private static VespaVersion createVersion(DeploymentStatistics statistics, - Set<ControllerVersion> controllerVersions, + ControllerVersion controllerVersion, Version systemVersion, boolean isReleased, NodeVersions nodeVersions, Controller controller) { - var latestVersion = controllerVersions.stream().max(Comparator.naturalOrder()).get(); - var controllerVersion = controllerVersions.stream().min(Comparator.naturalOrder()).get(); var isSystemVersion = statistics.version().equals(systemVersion); var isControllerVersion = statistics.version().equals(controllerVersion.version()); var confidence = controller.curator().readConfidenceOverrides().get(statistics.version()); @@ -260,8 +263,8 @@ public class VersionStatus { } // Preserve existing commit details if we've previously computed status for this version - var commitSha = latestVersion.commitSha(); - var commitDate = latestVersion.commitDate(); + var commitSha = controllerVersion.commitSha(); + var commitDate = controllerVersion.commitDate(); if (previousStatus != null) { commitSha = previousStatus.releaseCommit(); commitDate = previousStatus.committedAt(); @@ -272,7 +275,6 @@ public class VersionStatus { confidence = previousStatus.confidence(); } } - return new VespaVersion(statistics, commitSha, commitDate, |