Stop setting OS target version once all nodes have seen it
@@ -46,8 +46,10 @@ public class OsUpgrader extends InfrastructureUpgrader {
@Override
protected void upgrade(Version target, SystemApplication application, ZoneId zone) {
+ if (wantedVersion(zone, application, target).equals(target)) {
+ return;
+ }
log.info(String.format("Upgrading OS of %s to version %s in %s", application.id(), target, zone));
- // Node repository ensures the upgrade call is idempotent
application.nodeTypesWithUpgradableOs().forEach(nodeType -> controller().configServer().nodeRepository()
.upgradeOs(zone, nodeType, target));
}
@@ -75,6 +77,10 @@ public class OsUpgrader extends InfrastructureUpgrader {
return minVersion(zone, application, Node::currentOsVersion).orElse(defaultVersion);
}
+ private Version wantedVersion(ZoneId zone, SystemApplication application, Version defaultVersion) {
+ return minVersion(zone, application, Node::wantedOsVersion).orElse(defaultVersion);
+ }
+
/** Returns whether node in application should be upgraded by this */
public static boolean eligibleForUpgrade(Node node, SystemApplication application) {
return upgradableNodeStates.contains(node.state()) &&
